summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2008-06-25 17:30:53 +0000
committerfrosch <frosch@openttd.org>2008-06-25 17:30:53 +0000
commit983e5a96f0d497c3a363b82d153386fdaf615bb0 (patch)
tree0867863b6085a1724677effdc0636a0c0ad7c449 /src
parent41b09d402715512981620f9a291a2f118cc0709d (diff)
downloadopenttd-983e5a96f0d497c3a363b82d153386fdaf615bb0.tar.xz
(svn r13629) -Fix [FS#2108](r13603): diameter != radius
Diffstat (limited to 'src')
-rw-r--r--src/newgrf_house.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/newgrf_house.cpp b/src/newgrf_house.cpp
index 8fa10ba1a..7055722ee 100644
--- a/src/newgrf_house.cpp
+++ b/src/newgrf_house.cpp
@@ -274,10 +274,10 @@ static uint32 GetDistanceFromNearbyHouse(uint8 parameter, TileIndex tile, uint32
uint8 searchtype = GB(parameter, 6, 2);
uint8 searchradius = GB(parameter, 0, 6);
if (searchtype >= lengthof(search_procs)) return 0; // do not run on ill-defined code
- if (searchradius < 2) return 0; // do not use a too low radius
+ if (searchradius < 1) return 0; // do not use a too low radius
/* Use a pointer for the tile to start the search. Will be required for calculating the distance*/
- if (CircularTileSearch(&found_tile, searchradius, search_procs[searchtype], data)) {
+ if (CircularTileSearch(&found_tile, 2 * searchradius + 1, search_procs[searchtype], data)) {
return DistanceManhattan(found_tile, tile);
}
return 0;