diff options
author | tron <tron@openttd.org> | 2006-06-27 21:25:53 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-06-27 21:25:53 +0000 |
commit | 2b27073156f40df263cf653263488b8d72a76236 (patch) | |
tree | 1bfdb9c99b43fdc3b07ac13cbed4259a06d34f6f /ai/trolly/build.c | |
parent | c126ce110ee33bffe07dac5283d8a1648dc662b7 (diff) | |
download | openttd-2b27073156f40df263cf653263488b8d72a76236.tar.xz |
(svn r5391) Miscellaneous, mostly bracing and whitespace, nothing spectacular
Diffstat (limited to 'ai/trolly/build.c')
-rw-r--r-- | ai/trolly/build.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/ai/trolly/build.c b/ai/trolly/build.c index 64339245e..35359016a 100644 --- a/ai/trolly/build.c +++ b/ai/trolly/build.c @@ -286,14 +286,15 @@ int AiNew_Build_Vehicle(Player *p, TileIndex tile, byte flag) int AiNew_Build_Depot(Player* p, TileIndex tile, DiagDirection direction, byte flag) { int ret, ret2; - if (p->ainew.tbt == AI_TRAIN) + if (p->ainew.tbt == AI_TRAIN) { return AI_DoCommand(tile, 0, direction, flag | DC_AUTO | DC_NO_WATER, CMD_BUILD_TRAIN_DEPOT); - - 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), 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; + } else { + 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), 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; + } } |