summaryrefslogtreecommitdiff
path: root/vehicle.c
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-09-15 17:36:54 +0000
committerpeter1138 <peter1138@openttd.org>2006-09-15 17:36:54 +0000
commit851874d8e15dd23f270de077fec01ec1d9ae9500 (patch)
tree88c8c569de29765f3e2c7ad99604d0e0e4da6c74 /vehicle.c
parent88d5472fe897edf77ea08be7488e06d342fedd3a (diff)
downloadopenttd-851874d8e15dd23f270de077fec01ec1d9ae9500.tar.xz
(svn r6456) - Replace single colour scheme for passenger wagons with separate schemes for each of steam, diesel or electric engines. Savegames from the previous revision will not load.
Diffstat (limited to 'vehicle.c')
-rw-r--r--vehicle.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/vehicle.c b/vehicle.c
index 38875a76a..6d16bf60a 100644
--- a/vehicle.c
+++ b/vehicle.c
@@ -2322,8 +2322,19 @@ static PalSpriteID GetEngineColourMap(EngineID engine_type, PlayerID player, Eng
if (cargo_type == CT_INVALID) cargo_type = rvi->cargo_type;
if (rvi->flags & RVI_WAGON) {
- scheme = (cargo_type == CT_PASSENGERS || cargo_type == CT_MAIL || cargo_type == CT_VALUABLES) ?
- LS_PASSENGER_WAGON : LS_FREIGHT_WAGON;
+ if (cargo_type == CT_PASSENGERS || cargo_type == CT_MAIL || cargo_type == CT_VALUABLES) {
+ if (parent_engine_type == INVALID_ENGINE) {
+ scheme = LS_PASSENGER_WAGON_STEAM;
+ } else {
+ switch (RailVehInfo(parent_engine_type)->engclass) {
+ case 0: scheme = LS_PASSENGER_WAGON_STEAM; break;
+ case 1: scheme = LS_PASSENGER_WAGON_DIESEL; break;
+ case 2: scheme = LS_PASSENGER_WAGON_ELECTRIC; break;
+ }
+ }
+ } else {
+ scheme = LS_FREIGHT_WAGON;
+ }
} else {
bool is_mu = HASBIT(_engine_info[engine_type].misc_flags, EF_RAIL_IS_MU);