mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-09 07:29:44 +00:00
(svn r11928) -Fix (r6393): [autoreplace] autoreplace could refit train engines to the wrong cargo type if the old engine had no cargo capacity and the new one had
Now autoreplace will always look at the wagons to figure out what to replace to (as originally intended)
This commit is contained in:
parent
a580c8d059
commit
2f6ee3a4a1
@ -93,7 +93,7 @@ static CargoID GetNewCargoTypeForReplace(Vehicle *v, EngineID engine_type)
|
|||||||
|
|
||||||
if (new_cargo_type == CT_INVALID) return CT_NO_REFIT; // Don't try to refit an engine with no cargo capacity
|
if (new_cargo_type == CT_INVALID) return CT_NO_REFIT; // Don't try to refit an engine with no cargo capacity
|
||||||
|
|
||||||
if (v->cargo_type == new_cargo_type || CanRefitTo(engine_type, v->cargo_type)) {
|
if (v->cargo_cap != 0 && (v->cargo_type == new_cargo_type || CanRefitTo(engine_type, v->cargo_type))) {
|
||||||
if (VerifyAutoreplaceRefitForOrders(v, engine_type)) {
|
if (VerifyAutoreplaceRefitForOrders(v, engine_type)) {
|
||||||
return v->cargo_type == new_cargo_type ? (CargoID)CT_NO_REFIT : v->cargo_type;
|
return v->cargo_type == new_cargo_type ? (CargoID)CT_NO_REFIT : v->cargo_type;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user