summaryrefslogtreecommitdiff
path: root/rail_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-04-14 11:17:36 +0000
committertron <tron@openttd.org>2005-04-14 11:17:36 +0000
commitcada1e24b50d0a218b9b5ceadefed76b3d848bc5 (patch)
tree447124f75b7bb303261050370767d1ab3335f0c2 /rail_cmd.c
parent3b9931fcba9586d2beca4f2d2feea37ef3eba047 (diff)
downloadopenttd-cada1e24b50d0a218b9b5ceadefed76b3d848bc5.tar.xz
(svn r2195) Add CmdFailed() as the One True Way(tm) to check if a command failed.
Diffstat (limited to 'rail_cmd.c')
-rw-r--r--rail_cmd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/rail_cmd.c b/rail_cmd.c
index 2a243b17f..b7724d553 100644
--- a/rail_cmd.c
+++ b/rail_cmd.c
@@ -307,7 +307,7 @@ int32 CmdBuildSingleRail(int x, int y, uint32 flags,
switch (m5 & 0x38) { // what's under the bridge?
case 0x00: // clear land
ret = CheckRailSlope(tileh, rail_bit, 0, tile);
- if (ret & CMD_ERROR) return ret;
+ if (CmdFailed(ret)) return ret;
cost += ret;
if (flags & DC_EXEC) {
@@ -340,7 +340,7 @@ int32 CmdBuildSingleRail(int x, int y, uint32 flags,
}
ret = CheckRailSlope(tileh, rail_bit, m5 & RAIL_BIT_MASK, tile);
- if (ret & CMD_ERROR) return ret;
+ if (CmdFailed(ret)) return ret;
cost += ret;
if (flags & DC_EXEC) _map5[tile] = m5 | rail_bit;
@@ -370,11 +370,11 @@ int32 CmdBuildSingleRail(int x, int y, uint32 flags,
default:
ret = CheckRailSlope(tileh, rail_bit, 0, tile);
- if (ret & CMD_ERROR) return ret;
+ if (CmdFailed(ret)) return ret;
cost += ret;
ret = DoCommandByTile(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
- if (ret == CMD_ERROR) return ret;
+ if (CmdFailed(ret)) return ret;
cost += ret;
if (flags & DC_EXEC) {