summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-11-06 13:00:44 +0100
committerErich Eckner <git@eckner.net>2022-01-16 21:58:16 +0100
commit9ea085f4e38a0cbeca47cdfec00034583ccd9cad (patch)
tree0a5f2b9ef1af3c35beddfa4ca2dc1f0606fec4a8
parent89e37dcb66b589de1bcddfc6b914c6608964f0ad (diff)
downloadopenttd-9ea085f4e38a0cbeca47cdfec00034583ccd9cad.tar.xz
do not fail on removing second to last tile from a station
-rw-r--r--src/map.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/map.cpp b/src/map.cpp
index e47332c1d..7430c1a2e 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -273,6 +273,7 @@ bool CircularTileSearch(TileIndex *tile, uint size, TestTileOnSearchProc proc, v
/* If tile test is not successful, get one tile up,
* ready for a test in first circle around center tile */
*tile = TileAddByDir(*tile, DIR_N);
+ if (size / 2 == 0) return false;
return CircularTileSearch(tile, size / 2, 1, 1, proc, user_data);
} else {
return CircularTileSearch(tile, size / 2, 0, 0, proc, user_data);