Codechange: Un-bitstuff landscape commands.

This commit is contained in:
Michael Lutz
2021-11-21 23:02:29 +01:00
parent e6e69d5289
commit c6d7b98808
26 changed files with 134 additions and 141 deletions

View File

@@ -231,7 +231,7 @@ CommandCost CmdBuildObject(DoCommandFlag flags, TileIndex tile, uint32 p1, uint3
if (type == OBJECT_OWNED_LAND) {
/* Owned land is special as it can be placed on any slope. */
cost.AddCost(Command<CMD_LANDSCAPE_CLEAR>::Do(flags, tile, 0, 0, {}));
cost.AddCost(Command<CMD_LANDSCAPE_CLEAR>::Do(flags, tile));
} else {
/* Check the surface to build on. At this time we can't actually execute the
* the CLEAR_TILE commands since the newgrf callback later on can check
@@ -244,7 +244,7 @@ CommandCost CmdBuildObject(DoCommandFlag flags, TileIndex tile, uint32 p1, uint3
if (!IsWaterTile(t)) {
/* Normal water tiles don't have to be cleared. For all other tile types clear
* the tile but leave the water. */
cost.AddCost(Command<CMD_LANDSCAPE_CLEAR>::Do(flags & ~DC_NO_WATER & ~DC_EXEC, t, 0, 0, {}));
cost.AddCost(Command<CMD_LANDSCAPE_CLEAR>::Do(flags & ~DC_NO_WATER & ~DC_EXEC, t));
} else {
/* Can't build on water owned by another company. */
Owner o = GetTileOwner(t);
@@ -262,7 +262,7 @@ CommandCost CmdBuildObject(DoCommandFlag flags, TileIndex tile, uint32 p1, uint3
IsTileType(t, MP_OBJECT) &&
IsTileOwner(t, _current_company) &&
IsObjectType(t, OBJECT_HQ))) {
cost.AddCost(Command<CMD_LANDSCAPE_CLEAR>::Do(flags & ~DC_EXEC, t, 0, 0, {}));
cost.AddCost(Command<CMD_LANDSCAPE_CLEAR>::Do(flags & ~DC_EXEC, t));
}
}
}
@@ -294,10 +294,10 @@ CommandCost CmdBuildObject(DoCommandFlag flags, TileIndex tile, uint32 p1, uint3
for (TileIndex t : ta) {
if (HasTileWaterGround(t)) {
if (!IsWaterTile(t)) {
Command<CMD_LANDSCAPE_CLEAR>::Do((flags & ~DC_NO_WATER) | DC_NO_MODIFY_TOWN_RATING, t, 0, 0, {});
Command<CMD_LANDSCAPE_CLEAR>::Do((flags & ~DC_NO_WATER) | DC_NO_MODIFY_TOWN_RATING, t);
}
} else {
Command<CMD_LANDSCAPE_CLEAR>::Do(flags | DC_NO_MODIFY_TOWN_RATING, t, 0, 0, {});
Command<CMD_LANDSCAPE_CLEAR>::Do(flags | DC_NO_MODIFY_TOWN_RATING, t);
}
}
}
@@ -849,7 +849,7 @@ static CommandCost TerraformTile_Object(TileIndex tile, DoCommandFlag flags, int
}
}
return Command<CMD_LANDSCAPE_CLEAR>::Do(flags, tile, 0, 0, {});
return Command<CMD_LANDSCAPE_CLEAR>::Do(flags, tile);
}
extern const TileTypeProcs _tile_type_object_procs = {