summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Nelson <peter1138@openttd.org>2019-01-25 23:16:34 +0000
committerCharles Pigott <charlespigott@googlemail.com>2019-01-26 00:25:18 +0000
commitb6de8c093010887a2962c677ca042faab9c87eeb (patch)
tree09956b6eae9b21790bfbd7449b4baa8635e55eaf
parent1334cfb3e5fd13fb51dc9cbf0690f55f5a57c4bf (diff)
downloadopenttd-b6de8c093010887a2962c677ca042faab9c87eeb.tar.xz
Fix #7098, Fix #7061: Inverted test led to invalid iterator access.
-rw-r--r--src/terraform_cmd.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/terraform_cmd.cpp b/src/terraform_cmd.cpp
index 5b476da18..9839f5e34 100644
--- a/src/terraform_cmd.cpp
+++ b/src/terraform_cmd.cpp
@@ -313,7 +313,7 @@ CommandCost CmdTerraformLand(TileIndex tile, DoCommandFlag flags, uint32 p1, uin
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(tile);
- if (new_height != ts.tile_to_new_height.end()) continue;
+ if (new_height == ts.tile_to_new_height.end()) continue;
MarkTileDirtyByTile(*it, 0, new_height->second);
}