(svn r14416) -Fix (r10074)(r10517): substraction was done the other way in the 'nearest land/water' check (~25% performance penalty)
authorsmatz
Mon, 29 Sep 2008 18:34:05 +0000
changeset 10203 cec7c76ca505
parent 10202 2dcd2c490934
child 10204 38f5dd6697e2
(svn r14416) -Fix (r10074)(r10517): substraction was done the other way in the 'nearest land/water' check (~25% performance penalty)
src/newgrf_industries.cpp
--- a/src/newgrf_industries.cpp	Mon Sep 29 18:23:56 2008 +0000
+++ b/src/newgrf_industries.cpp	Mon Sep 29 18:34:05 2008 +0000
@@ -73,7 +73,7 @@
 			} 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;
 			}
 		}