summaryrefslogtreecommitdiff
path: root/src/newgrf_industries.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-09-29 18:23:56 +0000
committersmatz <smatz@openttd.org>2008-09-29 18:23:56 +0000
commitc631c26a9f9d8b21c6dcf447f59e96f17363a2a5 (patch)
treedebb7fbb62b28da95ff3ef8e7d9339fa0f8886d2 /src/newgrf_industries.cpp
parente7829c1a57014f8b40b4972ab5b45dbcf4bb067d (diff)
downloadopenttd-c631c26a9f9d8b21c6dcf447f59e96f17363a2a5.tar.xz
(svn r14415) -Fix (r10074): void tiles could be the nearest 'land' for water industries
Diffstat (limited to 'src/newgrf_industries.cpp')
-rw-r--r--src/newgrf_industries.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/newgrf_industries.cpp b/src/newgrf_industries.cpp
index 307cd2c0c..b01f9e738 100644
--- a/src/newgrf_industries.cpp
+++ b/src/newgrf_industries.cpp
@@ -52,7 +52,7 @@ static uint GetClosestWaterDistance(TileIndex tile, bool water)
TileIndex t;
int best_dist;
for (t = 0; t < MapSize(); t++) {
- if (IsTileType(t, MP_WATER) == water) break;
+ if (!IsTileType(t, MP_VOID) && IsTileType(t, MP_WATER) == water) break;
}
if (t == MapSize() && !water) return 0x200;
best_dist = DistanceManhattan(tile, t);
@@ -60,7 +60,7 @@ static uint GetClosestWaterDistance(TileIndex tile, bool water)
for (; t < MapSize(); t++) {
int dist = DistanceManhattan(tile, t);
if (dist < best_dist) {
- if (IsTileType(t, MP_WATER) == water) best_dist = dist;
+ if (!IsTileType(t, MP_VOID) && IsTileType(t, MP_WATER) == water) best_dist = dist;
} else {
/* When the Y distance between the current row and the 'source' tile
* is larger than the best distance, we've found the best distance */