Merge branch 'master' into jgrpp
# Conflicts: # cmake/CompileFlags.cmake # src/cargomonitor.cpp # src/core/CMakeLists.txt # src/economy.cpp # src/landscape.cpp # src/linkgraph/flowmapper.cpp # src/linkgraph/linkgraph_gui.cpp # src/linkgraph/linkgraphschedule.cpp # src/misc_gui.cpp # src/newgrf_generic.cpp # src/newgrf_storage.cpp # src/rail_gui.cpp # src/saveload/afterload.cpp # src/saveload/station_sl.cpp # src/script/script_gui.cpp # src/station_cmd.cpp # src/station_gui.cpp # src/string_func.h # src/terraform_cmd.cpp
This commit is contained in:
@@ -223,9 +223,7 @@ CommandCost CmdTerraformLand(TileIndex tile, DoCommandFlag flags, uint32 p1, uin
|
||||
* Pass == 0: Collect tileareas which are caused to be auto-cleared.
|
||||
* Pass == 1: Collect the actual cost. */
|
||||
for (int pass = 0; pass < 2; pass++) {
|
||||
for (TileIndexSet::const_iterator it = ts.dirty_tiles.begin(); it != ts.dirty_tiles.end(); it++) {
|
||||
TileIndex t = *it;
|
||||
|
||||
for (const auto &t : ts.dirty_tiles) {
|
||||
assert(t < MapSize());
|
||||
/* MP_VOID tiles can be terraformed but as tunnels and bridges
|
||||
* cannot go under / over these tiles they don't need checking. */
|
||||
@@ -309,18 +307,17 @@ CommandCost CmdTerraformLand(TileIndex tile, DoCommandFlag flags, uint32 p1, uin
|
||||
|
||||
if (flags & DC_EXEC) {
|
||||
/* Mark affected areas dirty. */
|
||||
for (TileIndexSet::const_iterator it = ts.dirty_tiles.begin(); it != ts.dirty_tiles.end(); it++) {
|
||||
MarkTileDirtyByTile(*it);
|
||||
TileIndexToHeightMap::const_iterator new_height = ts.tile_to_new_height.find(*it);
|
||||
for (const auto &t : ts.dirty_tiles) {
|
||||
MarkTileDirtyByTile(t);
|
||||
TileIndexToHeightMap::const_iterator new_height = ts.tile_to_new_height.find(t);
|
||||
if (new_height == ts.tile_to_new_height.end()) continue;
|
||||
MarkTileDirtyByTile(*it, VMDF_NONE, 0, new_height->second);
|
||||
MarkTileDirtyByTile(t, VMDF_NONE, 0, new_height->second);
|
||||
}
|
||||
|
||||
/* change the height */
|
||||
for (TileIndexToHeightMap::const_iterator it = ts.tile_to_new_height.begin();
|
||||
it != ts.tile_to_new_height.end(); it++) {
|
||||
TileIndex t = it->first;
|
||||
int height = it->second;
|
||||
for (const auto &it : ts.tile_to_new_height) {
|
||||
TileIndex t = it.first;
|
||||
int height = it.second;
|
||||
|
||||
SetTileHeight(t, (uint)height);
|
||||
}
|
||||
|
Reference in New Issue
Block a user