summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-01-07 20:56:50 +0000
committeryexo <yexo@openttd.org>2010-01-07 20:56:50 +0000
commitbe3ca424f6ae8f7d9f6b21563152aa894b729c45 (patch)
treef8495bd880575afea5ea635d588f19fc7ca154a4
parentbe6fb855e8661cb8b461ba7bd256231b44816310 (diff)
downloadopenttd-be3ca424f6ae8f7d9f6b21563152aa894b729c45.tar.xz
(svn r18755) -Fix [FS#3495] (r14847): CircularTileSearch skipped a few tiles close to the starting tile
-rw-r--r--src/map.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/map.cpp b/src/map.cpp
index 435874598..0d2b146ce 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -245,9 +245,9 @@ bool CircularTileSearch(TileIndex *tile, uint size, TestTileOnSearchProc proc, v
* separately, as the pattern of uneven sides requires to go around the center */
if (proc(*tile, user_data)) return true;
- /* If tile test is not successful, get one tile down and left,
+ /* If tile test is not successful, get one tile up,
* ready for a test in first circle around center tile */
- *tile = TILE_ADD(*tile, TileOffsByDir(DIR_W));
+ *tile = TILE_ADD(*tile, TileOffsByDir(DIR_N));
return CircularTileSearch(tile, size / 2, 1, 1, proc, user_data);
} else {
return CircularTileSearch(tile, size / 2, 0, 0, proc, user_data);
@@ -261,7 +261,8 @@ bool CircularTileSearch(TileIndex *tile, uint size, TestTileOnSearchProc proc, v
* without a hole, set either h or w to zero.
* Every tile will be tested by means of the callback function proc,
* which will determine if yes or no the given tile meets criteria of search.
- * @param tile to start the search from. Upon completion, it will return the tile matching the search
+ * @param tile to start the search from. Upon completion, it will return the tile matching the search.
+ * This tile should be directly north of the hole (if any).
* @param radius How many tiles to search outwards. Note: This is a radius and thus different
* from the size parameter of the other CircularTileSearch function, which is a diameter.
* @param w the width of the inner rectangle