From 5ba7c672da004302fb9ffbb2cc4d47d5fd8dfa6a Mon Sep 17 00:00:00 2001 From: smatz Date: Sat, 3 Jan 2009 16:27:52 +0000 Subject: (svn r14808) -Fix (r1): coal mine subsidence could wrap around map edges --- src/disaster_cmd.cpp | 6 +++--- 1 file 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; -- cgit v1.2.3-70-g09d2