From efcafe49f72510acb4244ed5766be7ebea7e3a4a Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Tue, 3 Dec 2024 21:59:22 +0000 Subject: [PATCH] Fix: [NewGRF] New engines did not have a default cargo type set. (#13146) Engines defined outside the original range did not have their cargo type/cargo label fields initialised properly. If these engines are also not assigned a cargo type, they would therefore use the cargo in slot 0 instead of falling back to first refittable. --- src/engine.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/engine.cpp b/src/engine.cpp index 79bff97e15..74aa3d751c 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -85,8 +85,9 @@ Engine::Engine(VehicleType type, EngineID base) this->info.base_life = 0xFF; /* Set road vehicle tractive effort to the default value */ if (type == VEH_ROAD) this->u.road.tractive_effort = 0x4C; - /* Aircraft must have INVALID_CARGO as default, as there is no property */ - if (type == VEH_AIRCRAFT) this->info.cargo_type = INVALID_CARGO; + /* Aircraft must have CT_INVALID as default, as there is no property */ + this->info.cargo_type = INVALID_CARGO; + this->info.cargo_label = (type == VEH_AIRCRAFT) ? CT_INVALID : CT_PASSENGERS; /* Ships must have a non-zero acceleration. */ if (type == VEH_SHIP) this->u.ship.acceleration = 1; /* Set visual effect to the default value */