summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-09-19 18:39:14 +0000
committerrubidium <rubidium@openttd.org>2007-09-19 18:39:14 +0000
commit42b629c78c7f01d1985ceecf827fac972efbb5c1 (patch)
tree54c17255acfcd8877f223c7535c0cf4fdecc7e79 /src
parent5d4311c07abee27bdf2893e04304b7ed9befd6b3 (diff)
downloadopenttd-42b629c78c7f01d1985ceecf827fac972efbb5c1.tar.xz
(svn r11131) -Fix (r11126): forgot to commit the changes that performed the actual fix.
Diffstat (limited to 'src')
-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 aaea06dc8..608b7ff05 100644
--- a/src/newgrf_industries.cpp
+++ b/src/newgrf_industries.cpp
@@ -59,12 +59,12 @@ static uint GetClosestWaterDistance(TileIndex tile, bool water)
/* When the Y distance between the current row and the 'source' tile
* is larger than the best distance, we've found the best distance */
if ((int)TileY(t) - (int)TileY(tile) > best_dist) break;
- if (TileX(tile) > TileX(t)) {
+ if ((int)TileX(t) - (int)TileX(tile) > best_dist) {
/* We can safely skip this many tiles; from here all tiles have a
* higher or equal distance than the best distance */
t |= MapMaxX();
continue;
- } else {
+ } else if (TileX(tile) < TileX(t)) {
/* We can safely skip this many tiles; up to here all tiles have a
* higher or equal distance than the best distance */
t += max(best_dist - dist, 0);