26 // flag : flag passed to DoCommand (normally 0 to get the cost or DC_EXEC to build it) |
27 // flag : flag passed to DoCommand (normally 0 to get the cost or DC_EXEC to build it) |
27 int AiNew_Build_Station(Player *p, byte type, uint tile, byte length, byte numtracks, byte direction, byte flag) { |
28 int AiNew_Build_Station(Player *p, byte type, uint tile, byte length, byte numtracks, byte direction, byte flag) { |
28 if (type == AI_TRAIN) |
29 if (type == AI_TRAIN) |
29 return DoCommandByTile(tile, direction + (numtracks << 8) + (length << 16), 0, flag | DC_AUTO | DC_NO_WATER, CMD_BUILD_RAILROAD_STATION); |
30 return DoCommandByTile(tile, direction + (numtracks << 8) + (length << 16), 0, flag | DC_AUTO | DC_NO_WATER, CMD_BUILD_RAILROAD_STATION); |
30 else if (type == AI_BUS) |
31 else if (type == AI_BUS) |
31 return DoCommandByTile(tile, direction, 0, flag | DC_AUTO | DC_NO_WATER, CMD_BUILD_BUS_STATION); |
32 return DoCommandByTile(tile, direction, RS_BUS, flag | DC_AUTO | DC_NO_WATER, CMD_BUILD_ROAD_STOP); |
32 else |
33 else |
33 return DoCommandByTile(tile, direction, 0, flag | DC_AUTO | DC_NO_WATER, CMD_BUILD_TRUCK_STATION); |
34 return DoCommandByTile(tile, direction, RS_TRUCK, flag | DC_AUTO | DC_NO_WATER, CMD_BUILD_ROAD_STOP); |
34 } |
35 } |
35 |
36 |
36 // Builds a brdige. The second best out of the ones available for this player |
37 // Builds a brdige. The second best out of the ones available for this player |
37 // Params: |
38 // Params: |
38 // tile_a : starting point |
39 // tile_a : starting point |