(svn r4677) - Backport from trunk (r4508): 0.4
authorDarkvater
Tue, 02 May 2006 13:42:33 +0000
branch0.4
changeset 9991 6512418e7678
parent 9990 2a5460a73917
child 9992 36665e9fb144
(svn r4677) - Backport from trunk (r4508):
Fix: Fixed a problem that caused DeliverGoodsToIndustry to not work
as intended
economy.c
--- a/economy.c	Tue May 02 13:37:36 2006 +0000
+++ b/economy.c	Tue May 02 13:42:33 2006 +0000
@@ -1142,13 +1142,13 @@
 	/* Check if there's an industry close to the station that accepts
 	 * the cargo */
 	best = NULL;
-	u = _patches.station_spread + 8;
+	u = (_patches.station_spread + 8) * 2;
 	FOR_ALL_INDUSTRIES(ind) {
 		if (ind->xy != 0 && (cargo_type == ind->accepts_cargo[0] || cargo_type
 				 == ind->accepts_cargo[1] || cargo_type == ind->accepts_cargo[2]) &&
 				 ind->produced_cargo[0] != CT_INVALID &&
 				 ind->produced_cargo[0] != cargo_type &&
-				 (t = DistanceManhattan(ind->xy, xy)) < 2 * u) {
+				 (t = DistanceManhattan(ind->xy, xy)) < 2) {
 			u = t;
 			best = ind;
 		}