From a8ddd501577f221d695975c58131535aadba09cd Mon Sep 17 00:00:00 2001 From: Darkvater Date: Tue, 2 May 2006 13:42:33 +0000 Subject: [PATCH] (svn r4677) - Backport from trunk (r4508): Fix: Fixed a problem that caused DeliverGoodsToIndustry to not work as intended --- economy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/economy.c b/economy.c index 725b33c35e..b45c5956be 100644 --- a/economy.c +++ b/economy.c @@ -1142,13 +1142,13 @@ static void DeliverGoodsToIndustry(TileIndex xy, byte cargo_type, int num_pieces /* 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; }