From e65771f25c678bc2bc9b465411b0dd70154bcd6a Mon Sep 17 00:00:00 2001 From: smatz Date: Mon, 29 Sep 2008 18:34:05 +0000 Subject: (svn r14416) -Fix (r10074)(r10517): substraction was done the other way in the 'nearest land/water' check (~25% performance penalty) --- src/newgrf_industries.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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; } } -- cgit v1.2.3-70-g09d2