summaryrefslogtreecommitdiff
path: root/town_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-11-15 10:50:43 +0000
committertron <tron@openttd.org>2005-11-15 10:50:43 +0000
commitb5dafb8f9498ce9f230681f28d7aeb14fde27f9b (patch)
tree30a71e475ecff76b78d3547240a338275fe6bd4d /town_cmd.c
parent24f857ed5edab0bf79b1f0f2c18b9a6280103ffb (diff)
downloadopenttd-b5dafb8f9498ce9f230681f28d7aeb14fde27f9b.tar.xz
(svn r3188) Use CmdFailed() to check, if a command failed, don't compare with CMD_ERROR
Diffstat (limited to 'town_cmd.c')
-rw-r--r--town_cmd.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/town_cmd.c b/town_cmd.c
index d613bf78b..d63883bc1 100644
--- a/town_cmd.c
+++ b/town_cmd.c
@@ -518,9 +518,10 @@ no_slope:
res = DoCommandByTile(tile, slope^0xF, 1, DC_EXEC | DC_AUTO | DC_NO_WATER,
CMD_TERRAFORM_LAND);
}
- if (res == CMD_ERROR && CHANCE16I(1,3,r))
+ if (CmdFailed(res) && CHANCE16I(1, 3, r)) {
// We can consider building on the slope, though.
goto no_slope;
+ }
}
return false;
}
@@ -535,8 +536,7 @@ static bool TerraformTownTile(TileIndex tile, int edges, int dir)
TILE_ASSERT(tile);
r = DoCommandByTile(tile, edges, dir, DC_AUTO | DC_NO_WATER, CMD_TERRAFORM_LAND);
- if (r == CMD_ERROR || r >= 126*16)
- return false;
+ if (CmdFailed(r) || r >= 126 * 16) return false;
DoCommandByTile(tile, edges, dir, DC_AUTO | DC_NO_WATER | DC_EXEC, CMD_TERRAFORM_LAND);
return true;
}
@@ -1577,8 +1577,7 @@ static bool DoBuildStatueOfCompany(TileIndex tile)
r = DoCommandByTile(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR);
_current_player = old;
- if (r == CMD_ERROR)
- return false;
+ if (CmdFailed(r)) return false;
ModifyTile(tile, MP_SETTYPE(MP_UNMOVABLE) | MP_MAPOWNER_CURRENT | MP_MAP5,
2 /* map5 */