1
0
Fork 0

(svn r3188) Use CmdFailed() to check, if a command failed, don't compare with CMD_ERROR

release/0.4.5
tron 2005-11-15 10:50:43 +00:00
parent 24f857ed5e
commit b5dafb8f94
1 changed files with 4 additions and 5 deletions

View File

@ -518,10 +518,11 @@ no_slope:
res = DoCommandByTile(tile, slope^0xF, 1, DC_EXEC | DC_AUTO | DC_NO_WATER, res = DoCommandByTile(tile, slope^0xF, 1, DC_EXEC | DC_AUTO | DC_NO_WATER,
CMD_TERRAFORM_LAND); 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. // We can consider building on the slope, though.
goto no_slope; goto no_slope;
} }
}
return false; return false;
} }
return true; return true;
@ -535,8 +536,7 @@ static bool TerraformTownTile(TileIndex tile, int edges, int dir)
TILE_ASSERT(tile); TILE_ASSERT(tile);
r = DoCommandByTile(tile, edges, dir, DC_AUTO | DC_NO_WATER, CMD_TERRAFORM_LAND); r = DoCommandByTile(tile, edges, dir, DC_AUTO | DC_NO_WATER, CMD_TERRAFORM_LAND);
if (r == CMD_ERROR || r >= 126*16) if (CmdFailed(r) || r >= 126 * 16) return false;
return false;
DoCommandByTile(tile, edges, dir, DC_AUTO | DC_NO_WATER | DC_EXEC, CMD_TERRAFORM_LAND); DoCommandByTile(tile, edges, dir, DC_AUTO | DC_NO_WATER | DC_EXEC, CMD_TERRAFORM_LAND);
return true; return true;
} }
@ -1577,8 +1577,7 @@ static bool DoBuildStatueOfCompany(TileIndex tile)
r = DoCommandByTile(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR); r = DoCommandByTile(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR);
_current_player = old; _current_player = old;
if (r == CMD_ERROR) if (CmdFailed(r)) return false;
return false;
ModifyTile(tile, MP_SETTYPE(MP_UNMOVABLE) | MP_MAPOWNER_CURRENT | MP_MAP5, ModifyTile(tile, MP_SETTYPE(MP_UNMOVABLE) | MP_MAPOWNER_CURRENT | MP_MAP5,
2 /* map5 */ 2 /* map5 */