diff options
Diffstat (limited to 'ai/trolly/build.c')
-rw-r--r-- | ai/trolly/build.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ai/trolly/build.c b/ai/trolly/build.c index 235166cab..2d0b25ec5 100644 --- a/ai/trolly/build.c +++ b/ai/trolly/build.c @@ -5,6 +5,7 @@ #include "../../debug.h" #include "../../functions.h" #include "../../map.h" +#include "../../road_map.h" #include "../../tile.h" #include "../../command.h" #include "trolly.h" @@ -255,9 +256,8 @@ int AiNew_Build_Vehicle(Player *p, TileIndex tile, byte flag) return AI_DoCommand(tile, i, 0, flag, CMD_BUILD_ROAD_VEH); } -int AiNew_Build_Depot(Player *p, TileIndex tile, byte direction, byte flag) +int AiNew_Build_Depot(Player* p, TileIndex tile, DiagDirection direction, byte flag) { - static const byte _roadbits_by_dir[4] = {2,1,8,4}; int ret, ret2; if (p->ainew.tbt == AI_TRAIN) return AI_DoCommand(tile, 0, direction, flag | DC_AUTO | DC_NO_WATER, CMD_BUILD_TRAIN_DEPOT); @@ -265,7 +265,7 @@ int AiNew_Build_Depot(Player *p, TileIndex tile, byte direction, byte flag) ret = AI_DoCommand(tile, direction, 0, flag | DC_AUTO | DC_NO_WATER, CMD_BUILD_ROAD_DEPOT); if (CmdFailed(ret)) return ret; // Try to build the road from the depot - ret2 = AI_DoCommand(tile + TileOffsByDir(direction), _roadbits_by_dir[direction], 0, flag | DC_AUTO | DC_NO_WATER, CMD_BUILD_ROAD); + ret2 = AI_DoCommand(tile + TileOffsByDir(direction), DiagDirToRoadBits(ReverseDiagDir(direction)), 0, flag | DC_AUTO | DC_NO_WATER, CMD_BUILD_ROAD); // If it fails, ignore it.. if (CmdFailed(ret2)) return ret; return ret + ret2; |