summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-09-29 18:34:05 +0000
committersmatz <smatz@openttd.org>2008-09-29 18:34:05 +0000
commit8c5cfd6850ecfe1b693050fdd80769e94e906f54 (patch)
treeb90892bc1f51a299de3154bd0ea9fb7298f161d7 /src
parent1c126cb2e65cf5823ad8fc25bf0fe329a37177ad (diff)
downloadopenttd-8c5cfd6850ecfe1b693050fdd80769e94e906f54.tar.xz
(svn r14416) -Fix (r10074)(r10517): substraction was done the other way in the 'nearest land/water' check (~25% performance penalty)
Diffstat (limited to 'src')
-rw-r--r--src/newgrf_industries.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/newgrf_industries.cpp b/src/newgrf_industries.cpp
index b01f9e738..62be8444b 100644
--- a/src/newgrf_industries.cpp
+++ b/src/newgrf_industries.cpp
@@ -73,7 +73,7 @@ static uint GetClosestWaterDistance(TileIndex tile, bool water)
} 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);
+ t += dist - best_dist;
continue;
}
}