(svn r14031) -Fix (r13850): Determining the refit cargo did not work, when the old vehicle did not carry anything but the new one did.
authorfrosch
Sat, 09 Aug 2008 16:42:55 +0000
changeset 9883 77893558228d
parent 9882 aa5f19fddb3c
child 9884 e33430df09e6
(svn r14031) -Fix (r13850): Determining the refit cargo did not work, when the old vehicle did not carry anything but the new one did.
src/autoreplace_cmd.cpp
--- a/src/autoreplace_cmd.cpp	Sat Aug 09 11:04:42 2008 +0000
+++ b/src/autoreplace_cmd.cpp	Sat Aug 09 16:42:55 2008 +0000
@@ -123,7 +123,7 @@
 				/* Do we have to refit the vehicle, or is it already carrying the right cargo? */
 				uint16 *default_capacity = GetCapacityOfArticulatedParts(engine_type, v->type);
 				for (CargoID cid = 0; cid < NUM_CARGO; cid++) {
-					if (cid != cargo_type && default_capacity[cid] > 0) return cargo_type;
+					if (cid != v->cargo_type && default_capacity[cid] > 0) return v->cargo_type;
 				}
 
 				return CT_NO_REFIT;