summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Nelson <peter1138@openttd.org>2019-02-02 15:12:33 +0000
committerPeterN <peter@fuzzle.org>2019-02-02 16:57:47 +0000
commite8f1c446a6e164b5c37cc6d14010709becc52998 (patch)
tree39fd4e52f02a39015b05715a089f251bf65b8fa1 /src
parentc9d801a98df5ea19ef8aa12b0f3f798729d6a1f1 (diff)
downloadopenttd-e8f1c446a6e164b5c37cc6d14010709becc52998.tar.xz
Fix: DMU/EMU livery should apply to passenger carriages with DMU/EMU engines.
Diffstat (limited to 'src')
-rw-r--r--src/vehicle.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index a5fe2ffa7..62d279db6 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -1813,11 +1813,12 @@ LiveryScheme GetEngineLiveryScheme(EngineID engine_type, EngineID parent_engine_
if (parent_engine_type == INVALID_ENGINE) {
return LS_PASSENGER_WAGON_STEAM;
} else {
+ bool is_mu = HasBit(EngInfo(parent_engine_type)->misc_flags, EF_RAIL_IS_MU);
switch (RailVehInfo(parent_engine_type)->engclass) {
default: NOT_REACHED();
case EC_STEAM: return LS_PASSENGER_WAGON_STEAM;
- case EC_DIESEL: return LS_PASSENGER_WAGON_DIESEL;
- case EC_ELECTRIC: return LS_PASSENGER_WAGON_ELECTRIC;
+ case EC_DIESEL: return is_mu ? LS_DMU : LS_PASSENGER_WAGON_DIESEL;
+ case EC_ELECTRIC: return is_mu ? LS_EMU : LS_PASSENGER_WAGON_ELECTRIC;
case EC_MONORAIL: return LS_PASSENGER_WAGON_MONORAIL;
case EC_MAGLEV: return LS_PASSENGER_WAGON_MAGLEV;
}