summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-01-03 16:27:52 +0000
committersmatz <smatz@openttd.org>2009-01-03 16:27:52 +0000
commit16fb54da5e6bf3e515082f7f06afe19bac0f24af (patch)
tree2361c787823275e7f4d3be5d74d93da658d5e333 /src
parent254e19da91309da11416c69ae7899dc11e608df0 (diff)
downloadopenttd-16fb54da5e6bf3e515082f7f06afe19bac0f24af.tar.xz
(svn r14808) -Fix (r1): coal mine subsidence could wrap around map edges
Diffstat (limited to 'src')
-rw-r--r--src/disaster_cmd.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/disaster_cmd.cpp b/src/disaster_cmd.cpp
index 37a2a3bb0..ccdd230ca 100644
--- a/src/disaster_cmd.cpp
+++ b/src/disaster_cmd.cpp
@@ -983,11 +983,11 @@ static void Disaster_CoalMine_Init()
{
TileIndex tile = i->xy;
TileIndexDiff step = TileOffsByDiagDir((DiagDirection)GB(Random(), 0, 2));
- uint n;
- for (n = 0; n < 30; n++) {
+ for (uint n = 0; n < 30; n++) {
DisasterClearSquare(tile);
- tile = TILE_MASK(tile + step);
+ tile += step;
+ if (!IsValidTile(tile)) break;
}
}
return;