summaryrefslogtreecommitdiff
path: root/ai/trolly/build.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-06-27 21:25:53 +0000
committertron <tron@openttd.org>2006-06-27 21:25:53 +0000
commit772fbda3e37488c2bf7beb96d35b2cbe001d9eda (patch)
tree1bfdb9c99b43fdc3b07ac13cbed4259a06d34f6f /ai/trolly/build.c
parent7fa72c5e2f224243a8c89096f0b07259e05e44cf (diff)
downloadopenttd-772fbda3e37488c2bf7beb96d35b2cbe001d9eda.tar.xz
(svn r5391) Miscellaneous, mostly bracing and whitespace, nothing spectacular
Diffstat (limited to 'ai/trolly/build.c')
-rw-r--r--ai/trolly/build.c19
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;
+ }
}