Codechange: Un-bitstuff landscape commands.
This commit is contained in:
@@ -412,7 +412,7 @@ CommandCost CmdBuildBridge(DoCommandFlag flags, TileIndex tile_end, TileIndex ti
|
||||
bool allow_on_slopes = (_settings_game.construction.build_on_slopes && transport_type != TRANSPORT_WATER);
|
||||
|
||||
/* Try and clear the start landscape */
|
||||
CommandCost ret = Command<CMD_LANDSCAPE_CLEAR>::Do(flags, tile_start, 0, 0, {});
|
||||
CommandCost ret = Command<CMD_LANDSCAPE_CLEAR>::Do(flags, tile_start);
|
||||
if (ret.Failed()) return ret;
|
||||
cost = ret;
|
||||
|
||||
@@ -420,7 +420,7 @@ CommandCost CmdBuildBridge(DoCommandFlag flags, TileIndex tile_end, TileIndex ti
|
||||
cost.AddCost(terraform_cost_north);
|
||||
|
||||
/* Try and clear the end landscape */
|
||||
ret = Command<CMD_LANDSCAPE_CLEAR>::Do(flags, tile_end, 0, 0, {});
|
||||
ret = Command<CMD_LANDSCAPE_CLEAR>::Do(flags, tile_end);
|
||||
if (ret.Failed()) return ret;
|
||||
cost.AddCost(ret);
|
||||
|
||||
@@ -492,7 +492,7 @@ CommandCost CmdBuildBridge(DoCommandFlag flags, TileIndex tile_end, TileIndex ti
|
||||
default:
|
||||
not_valid_below:;
|
||||
/* try and clear the middle landscape */
|
||||
ret = Command<CMD_LANDSCAPE_CLEAR>::Do(flags, tile, 0, 0, {});
|
||||
ret = Command<CMD_LANDSCAPE_CLEAR>::Do(flags, tile);
|
||||
if (ret.Failed()) return ret;
|
||||
cost.AddCost(ret);
|
||||
break;
|
||||
@@ -663,7 +663,7 @@ CommandCost CmdBuildTunnel(DoCommandFlag flags, TileIndex start_tile, TransportT
|
||||
|
||||
if (HasTileWaterGround(start_tile)) return_cmd_error(STR_ERROR_CAN_T_BUILD_ON_WATER);
|
||||
|
||||
CommandCost ret = Command<CMD_LANDSCAPE_CLEAR>::Do(flags, start_tile, 0, 0, {});
|
||||
CommandCost ret = Command<CMD_LANDSCAPE_CLEAR>::Do(flags, start_tile);
|
||||
if (ret.Failed()) return ret;
|
||||
|
||||
/* XXX - do NOT change 'ret' in the loop, as it is used as the price
|
||||
@@ -723,7 +723,7 @@ CommandCost CmdBuildTunnel(DoCommandFlag flags, TileIndex start_tile, TransportT
|
||||
if (HasTileWaterGround(end_tile)) return_cmd_error(STR_ERROR_CAN_T_BUILD_ON_WATER);
|
||||
|
||||
/* Clear the tile in any case */
|
||||
ret = Command<CMD_LANDSCAPE_CLEAR>::Do(flags, end_tile, 0, 0, {});
|
||||
ret = Command<CMD_LANDSCAPE_CLEAR>::Do(flags, end_tile);
|
||||
if (ret.Failed()) return_cmd_error(STR_ERROR_UNABLE_TO_EXCAVATE_LAND);
|
||||
cost.AddCost(ret);
|
||||
|
||||
@@ -755,7 +755,7 @@ CommandCost CmdBuildTunnel(DoCommandFlag flags, TileIndex start_tile, TransportT
|
||||
assert(coa_index < UINT_MAX); // more than 2**32 cleared areas would be a bug in itself
|
||||
coa = nullptr;
|
||||
|
||||
ret = Command<CMD_TERRAFORM_LAND>::Do(flags, end_tile, end_tileh & start_tileh, 0, {});
|
||||
ret = Command<CMD_TERRAFORM_LAND>::Do(flags, end_tile, end_tileh & start_tileh, false);
|
||||
_cleared_object_areas[(uint)coa_index].first_tile = old_first_tile;
|
||||
if (ret.Failed()) return_cmd_error(STR_ERROR_UNABLE_TO_EXCAVATE_LAND);
|
||||
cost.AddCost(ret);
|
||||
@@ -1837,7 +1837,7 @@ static void ChangeTileOwner_TunnelBridge(TileIndex tile, Owner old_owner, Owner
|
||||
if (tt == TRANSPORT_RAIL) {
|
||||
/* Since all of our vehicles have been removed, it is safe to remove the rail
|
||||
* bridge / tunnel. */
|
||||
[[maybe_unused]] CommandCost ret = Command<CMD_LANDSCAPE_CLEAR>::Do(DC_EXEC | DC_BANKRUPT, tile, 0, 0, {});
|
||||
[[maybe_unused]] CommandCost ret = Command<CMD_LANDSCAPE_CLEAR>::Do(DC_EXEC | DC_BANKRUPT, tile);
|
||||
assert(ret.Succeeded());
|
||||
} else {
|
||||
/* In any other case, we can safely reassign the ownership to OWNER_NONE. */
|
||||
@@ -2028,7 +2028,7 @@ static CommandCost TerraformTile_TunnelBridge(TileIndex tile, DoCommandFlag flag
|
||||
if (res.Succeeded() && (z_old == z_new) && (tileh_old == tileh_new)) return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_FOUNDATION]);
|
||||
}
|
||||
|
||||
return Command<CMD_LANDSCAPE_CLEAR>::Do(flags, tile, 0, 0, {});
|
||||
return Command<CMD_LANDSCAPE_CLEAR>::Do(flags, tile);
|
||||
}
|
||||
|
||||
extern const TileTypeProcs _tile_type_tunnelbridge_procs = {
|
||||
|
Reference in New Issue
Block a user