economy.c
changeset 3613 6e13c86ae147
parent 3580 607e4245d024
child 3655 ed8ce86fb219
--- a/economy.c	Fri Apr 21 20:10:53 2006 +0000
+++ b/economy.c	Fri Apr 21 20:25:34 2006 +0000
@@ -1110,7 +1110,10 @@
 	uint u;
 
 	// Check if there's an industry close to the station that accepts the cargo
-	u = _patches.station_spread + 8;
+	// XXX - Think of something better to
+	//       1) Only deliver to industries which are withing the catchment radius
+	//       2) Distribute between industries if more then one is present
+	u = (_patches.station_spread + 8) * 2;
 	FOR_ALL_INDUSTRIES(ind) {
 		uint t;
 
@@ -1121,7 +1124,7 @@
 				) &&
 				ind->produced_cargo[0] != CT_INVALID &&
 				ind->produced_cargo[0] != cargo_type &&
-				(t = DistanceManhattan(ind->xy, xy)) < 2 * u) {
+				(t = DistanceManhattan(ind->xy, xy)) < u) {
 			u = t;
 			best = ind;
 		}