mirror of https://github.com/OpenTTD/OpenTTD
(svn r14031) -Fix (r13850): Determining the refit cargo did not work, when the old vehicle did not carry anything but the new one did.
parent
92afb4d9bd
commit
731685cf64
|
@ -123,7 +123,7 @@ static CargoID GetNewCargoTypeForReplace(Vehicle *v, EngineID engine_type)
|
||||||
/* Do we have to refit the vehicle, or is it already carrying the right cargo? */
|
/* Do we have to refit the vehicle, or is it already carrying the right cargo? */
|
||||||
uint16 *default_capacity = GetCapacityOfArticulatedParts(engine_type, v->type);
|
uint16 *default_capacity = GetCapacityOfArticulatedParts(engine_type, v->type);
|
||||||
for (CargoID cid = 0; cid < NUM_CARGO; cid++) {
|
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;
|
return CT_NO_REFIT;
|
||||||
|
|
Loading…
Reference in New Issue