diff options
author | rubidium <rubidium@openttd.org> | 2010-01-18 22:57:21 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-01-18 22:57:21 +0000 |
commit | 4d93b704d9f0e6e58dac1d97f79a05bd4320c43f (patch) | |
tree | f80050fa083b86d7a7d75efd1ae49a04b358666d /src/terraform_cmd.cpp | |
parent | d8e126d98ddc35df0ac97bd35a076edf1cf172c8 (diff) | |
download | openttd-4d93b704d9f0e6e58dac1d97f79a05bd4320c43f.tar.xz |
(svn r18866) -Codechange: remove the CmdFailed(ret)/CmdSucceeded(ret) wrapper functions
Diffstat (limited to 'src/terraform_cmd.cpp')
-rw-r--r-- | src/terraform_cmd.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/terraform_cmd.cpp b/src/terraform_cmd.cpp index 7ad1ad923..61df82d1f 100644 --- a/src/terraform_cmd.cpp +++ b/src/terraform_cmd.cpp @@ -218,7 +218,7 @@ static CommandCost TerraformTileHeight(TerraformerState *ts, TileIndex tile, int /* Terraform the neighboured corner. The resulting height difference should be 1. */ height_diff += (height_diff < 0 ? 1 : -1); CommandCost cost = TerraformTileHeight(ts, tile, r + height_diff); - if (CmdFailed(cost)) return cost; + if (cost.Failed()) return cost; total_cost.AddCost(cost); } } @@ -249,28 +249,28 @@ CommandCost CmdTerraformLand(TileIndex tile, DoCommandFlag flags, uint32 p1, uin if ((p1 & SLOPE_W) != 0 && tile + TileDiffXY(1, 0) < MapSize()) { TileIndex t = tile + TileDiffXY(1, 0); CommandCost cost = TerraformTileHeight(&ts, t, TileHeight(t) + direction); - if (CmdFailed(cost)) return cost; + if (cost.Failed()) return cost; total_cost.AddCost(cost); } if ((p1 & SLOPE_S) != 0 && tile + TileDiffXY(1, 1) < MapSize()) { TileIndex t = tile + TileDiffXY(1, 1); CommandCost cost = TerraformTileHeight(&ts, t, TileHeight(t) + direction); - if (CmdFailed(cost)) return cost; + if (cost.Failed()) return cost; total_cost.AddCost(cost); } if ((p1 & SLOPE_E) != 0 && tile + TileDiffXY(0, 1) < MapSize()) { TileIndex t = tile + TileDiffXY(0, 1); CommandCost cost = TerraformTileHeight(&ts, t, TileHeight(t) + direction); - if (CmdFailed(cost)) return cost; + if (cost.Failed()) return cost; total_cost.AddCost(cost); } if ((p1 & SLOPE_N) != 0) { TileIndex t = tile + TileDiffXY(0, 0); CommandCost cost = TerraformTileHeight(&ts, t, TileHeight(t) + direction); - if (CmdFailed(cost)) return cost; + if (cost.Failed()) return cost; total_cost.AddCost(cost); } @@ -319,7 +319,7 @@ CommandCost CmdTerraformLand(TileIndex tile, DoCommandFlag flags, uint32 p1, uin if (_game_mode == GM_EDITOR) _generating_world = true; // used to create green terraformed land CommandCost cost = _tile_type_procs[GetTileType(tile)]->terraform_tile_proc(tile, flags | DC_AUTO, z_min * TILE_HEIGHT, tileh); _generating_world = curr_gen; - if (CmdFailed(cost)) { + if (cost.Failed()) { _terraform_err_tile = tile; return cost; } @@ -386,7 +386,7 @@ CommandCost CmdLevelLand(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 uint curh = TileHeight(tile); while (curh != h) { CommandCost ret = DoCommand(tile, SLOPE_N, (curh > h) ? 0 : 1, flags & ~DC_EXEC, CMD_TERRAFORM_LAND); - if (CmdFailed(ret)) break; + if (ret.Failed()) break; if (flags & DC_EXEC) { money -= ret.GetCost(); |