summaryrefslogtreecommitdiff
path: root/water_cmd.c
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2005-12-10 12:05:39 +0000
committerpeter1138 <peter1138@openttd.org>2005-12-10 12:05:39 +0000
commit809b03c81a841fcc428943c65760c74f3d26df57 (patch)
tree4ae75b1c93989fadb955dd408fcc2c0589671b22 /water_cmd.c
parent6a6e1450106f9944f74021edcd9aec54b3cc11ab (diff)
downloadopenttd-809b03c81a841fcc428943c65760c74f3d26df57.tar.xz
(svn r3282) - Codechange: Replace tests against CMD_ERROR with CmdFailed()
Diffstat (limited to 'water_cmd.c')
-rw-r--r--water_cmd.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/water_cmd.c b/water_cmd.c
index a942cf1ef..dee9b2fe8 100644
--- a/water_cmd.c
+++ b/water_cmd.c
@@ -136,17 +136,17 @@ static int32 DoBuildShiplift(TileIndex tile, int dir, uint32 flags)
// middle tile
ret = DoCommandByTile(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
- if (ret == CMD_ERROR) return CMD_ERROR;
+ if (CmdFailed(ret)) return CMD_ERROR;
delta = TileOffsByDir(dir);
// lower tile
ret = DoCommandByTile(tile - delta, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
- if (ret == CMD_ERROR) return CMD_ERROR;
+ if (CmdFailed(ret)) return CMD_ERROR;
if (GetTileSlope(tile - delta, NULL)) return_cmd_error(STR_1000_LAND_SLOPED_IN_WRONG_DIRECTION);
// upper tile
ret = DoCommandByTile(tile + delta, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
- if (ret == CMD_ERROR) return CMD_ERROR;
+ if (CmdFailed(ret)) return CMD_ERROR;
if (GetTileSlope(tile + delta, NULL)) return_cmd_error(STR_1000_LAND_SLOPED_IN_WRONG_DIRECTION);
if (flags & DC_EXEC) {
@@ -530,7 +530,7 @@ static void TileLoopWaterHelper(TileIndex tile, const TileIndexDiffC *offs)
case MP_CLEAR:
case MP_TREES:
_current_player = OWNER_WATER;
- if (DoCommandByTile(target, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR) != CMD_ERROR) {
+ if (!CmdFailed(DoCommandByTile(target, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR))) {
ModifyTile(
target,
MP_SETTYPE(MP_WATER) | MP_MAPOWNER | MP_MAP5 | MP_MAP2_CLEAR |
@@ -569,7 +569,7 @@ static void TileLoopWaterHelper(TileIndex tile, const TileIndexDiffC *offs)
if (v != NULL) FloodVehicle(v);
}
- if (DoCommandByTile(target, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR) != CMD_ERROR) {
+ if (!CmdFailed(DoCommandByTile(target, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR))) {
ModifyTile(
target,
MP_SETTYPE(MP_WATER) | MP_MAPOWNER | MP_MAP5 | MP_MAP2_CLEAR |