diff --git a/src/vehicle.cpp b/src/vehicle.cpp --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -1954,7 +1954,8 @@ LiveryScheme GetEngineLiveryScheme(Engin } if (!IsValidCargoID(cargo_type)) cargo_type = e->GetDefaultCargoType(); - if (!IsValidCargoID(cargo_type)) cargo_type = CT_GOODS; // The vehicle does not carry anything, let's pick some freight cargo + if (!IsValidCargoID(cargo_type)) cargo_type = GetCargoIDByLabel(CT_GOODS); // The vehicle does not carry anything, let's pick some freight cargo + assert(IsValidCargoID(cargo_type)); if (e->u.rail.railveh_type == RAILVEH_WAGON) { if (!CargoSpec::Get(cargo_type)->is_freight) { if (parent_engine_type == INVALID_ENGINE) { @@ -1994,7 +1995,8 @@ LiveryScheme GetEngineLiveryScheme(Engin cargo_type = v->First()->cargo_type; } if (!IsValidCargoID(cargo_type)) cargo_type = e->GetDefaultCargoType(); - if (!IsValidCargoID(cargo_type)) cargo_type = CT_GOODS; // The vehicle does not carry anything, let's pick some freight cargo + if (!IsValidCargoID(cargo_type)) cargo_type = GetCargoIDByLabel(CT_GOODS); // The vehicle does not carry anything, let's pick some freight cargo + assert(IsValidCargoID(cargo_type)); /* Important: Use Tram Flag of front part. Luckily engine_type refers to the front part here. */ if (HasBit(e->info.misc_flags, EF_ROAD_TRAM)) { @@ -2007,7 +2009,8 @@ LiveryScheme GetEngineLiveryScheme(Engin case VEH_SHIP: if (!IsValidCargoID(cargo_type)) cargo_type = e->GetDefaultCargoType(); - if (!IsValidCargoID(cargo_type)) cargo_type = CT_GOODS; // The vehicle does not carry anything, let's pick some freight cargo + if (!IsValidCargoID(cargo_type)) cargo_type = GetCargoIDByLabel(CT_GOODS); // The vehicle does not carry anything, let's pick some freight cargo + assert(IsValidCargoID(cargo_type)); return IsCargoInClass(cargo_type, CC_PASSENGERS) ? LS_PASSENGER_SHIP : LS_FREIGHT_SHIP; case VEH_AIRCRAFT: