mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r11874) -Fix [FS#1655]: all wagons of maglev/monorail trains would get the livery colour of the engine instead of their wagon type.
This commit is contained in:
parent
7a66d5e21d
commit
2817e5425b
|
@ -1611,7 +1611,7 @@ STR_1008_MUST_REMOVE_RAILROAD_TRACK :{WHITE}Must rem
|
|||
STR_100A_RAILROAD_CONSTRUCTION :{WHITE}Railway Construction
|
||||
STR_TITLE_ELRAIL_CONSTRUCTION :{WHITE}Electrified Railway Construction
|
||||
STR_100B_MONORAIL_CONSTRUCTION :{WHITE}Monorail Construction
|
||||
STR_100C_MAGLEV_CONSTRUCTION :{WHITE}MagLev Construction
|
||||
STR_100C_MAGLEV_CONSTRUCTION :{WHITE}Maglev Construction
|
||||
STR_100D_SELECT_RAIL_BRIDGE :{WHITE}Select Rail Bridge
|
||||
STR_100E_CAN_T_BUILD_TRAIN_DEPOT :{WHITE}Can't build train depot here...
|
||||
STR_100F_CAN_T_BUILD_RAILROAD_STATION :{WHITE}Can't build railway station here...
|
||||
|
@ -1623,7 +1623,7 @@ STR_1014_TRAIN_DEPOT_ORIENTATION :{WHITE}Train De
|
|||
STR_1015_RAILROAD_CONSTRUCTION :Railway construction
|
||||
STR_TOOLB_ELRAIL_CONSTRUCTION :Electrified Railway construction
|
||||
STR_1016_MONORAIL_CONSTRUCTION :Monorail construction
|
||||
STR_1017_MAGLEV_CONSTRUCTION :MagLev construction
|
||||
STR_1017_MAGLEV_CONSTRUCTION :Maglev construction
|
||||
STR_1018_BUILD_RAILROAD_TRACK :{BLACK}Build railway track
|
||||
STR_1019_BUILD_TRAIN_DEPOT_FOR_BUILDING :{BLACK}Build train depot (for building and servicing trains)
|
||||
STR_101A_BUILD_RAILROAD_STATION :{BLACK}Build railway station
|
||||
|
@ -2342,6 +2342,8 @@ STR_LIVERY_EMU :EMU
|
|||
STR_LIVERY_PASSENGER_WAGON_STEAM :Passenger Coach (Steam)
|
||||
STR_LIVERY_PASSENGER_WAGON_DIESEL :Passenger Coach (Diesel)
|
||||
STR_LIVERY_PASSENGER_WAGON_ELECTRIC :Passenger Coach (Electric)
|
||||
STR_LIVERY_PASSENGER_WAGON_MONORAIL :Passenger Coach (Monorail)
|
||||
STR_LIVERY_PASSENGER_WAGON_MAGLEV :Passenger Coach (Maglev)
|
||||
STR_LIVERY_FREIGHT_WAGON :Freight Wagon
|
||||
STR_LIVERY_BUS :Bus
|
||||
STR_LIVERY_TRUCK :Lorry
|
||||
|
|
|
@ -23,6 +23,8 @@ enum LiveryScheme {
|
|||
LS_PASSENGER_WAGON_STEAM,
|
||||
LS_PASSENGER_WAGON_DIESEL,
|
||||
LS_PASSENGER_WAGON_ELECTRIC,
|
||||
LS_PASSENGER_WAGON_MONORAIL,
|
||||
LS_PASSENGER_WAGON_MAGLEV,
|
||||
LS_FREIGHT_WAGON,
|
||||
|
||||
/* Road vehicles */
|
||||
|
|
|
@ -256,7 +256,7 @@ static const StringID _colour_dropdown[] = {
|
|||
/* Association of liveries to livery classes */
|
||||
static const LiveryClass livery_class[LS_END] = {
|
||||
LC_OTHER,
|
||||
LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL,
|
||||
LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL,
|
||||
LC_ROAD, LC_ROAD,
|
||||
LC_SHIP, LC_SHIP,
|
||||
LC_AIRCRAFT, LC_AIRCRAFT, LC_AIRCRAFT,
|
||||
|
@ -266,7 +266,7 @@ static const LiveryClass livery_class[LS_END] = {
|
|||
/* Number of liveries in each class, used to determine the height of the livery window */
|
||||
static const byte livery_height[] = {
|
||||
1,
|
||||
11,
|
||||
13,
|
||||
4,
|
||||
2,
|
||||
3,
|
||||
|
|
|
@ -1201,12 +1201,19 @@ static void SaveLoad_PLYR(Player* p)
|
|||
}
|
||||
|
||||
/* Write each livery entry. */
|
||||
int num_liveries = CheckSavegameVersion(63) ? LS_END - 2 : LS_END;
|
||||
int num_liveries = CheckSavegameVersion(63) ? LS_END - 4 : (CheckSavegameVersion(85) ? LS_END - 2: LS_END);
|
||||
for (i = 0; i < num_liveries; i++) {
|
||||
SlObject(&p->livery[i], _player_livery_desc);
|
||||
}
|
||||
|
||||
if (num_liveries == LS_END - 2) {
|
||||
if (num_liveries < LS_END) {
|
||||
/* We want to insert some liveries somewhere in between. This means some have to be moved. */
|
||||
memmove(&p->livery[LS_FREIGHT_WAGON], &p->livery[LS_PASSENGER_WAGON_MONORAIL], (LS_END - LS_FREIGHT_WAGON) * sizeof(p->livery[0]));
|
||||
p->livery[LS_PASSENGER_WAGON_MONORAIL] = p->livery[LS_MONORAIL];
|
||||
p->livery[LS_PASSENGER_WAGON_MAGLEV] = p->livery[LS_MAGLEV];
|
||||
}
|
||||
|
||||
if (num_liveries == LS_END - 4) {
|
||||
/* Copy bus/truck liveries over to trams */
|
||||
p->livery[LS_PASSENGER_TRAM] = p->livery[LS_BUS];
|
||||
p->livery[LS_FREIGHT_TRAM] = p->livery[LS_TRUCK];
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
#include "table/strings.h"
|
||||
|
||||
extern const uint16 SAVEGAME_VERSION = 84;
|
||||
extern const uint16 SAVEGAME_VERSION = 85;
|
||||
uint16 _sl_version; ///< the major savegame version identifier
|
||||
byte _sl_minor_version; ///< the minor savegame version, DO NOT USE!
|
||||
|
||||
|
|
|
@ -2581,42 +2581,35 @@ const Livery *GetEngineLivery(EngineID engine_type, PlayerID player, EngineID pa
|
|||
case VEH_TRAIN: {
|
||||
const RailVehicleInfo *rvi = RailVehInfo(engine_type);
|
||||
|
||||
switch (rvi->railtype) {
|
||||
default: NOT_REACHED();
|
||||
case RAILTYPE_RAIL:
|
||||
case RAILTYPE_ELECTRIC:
|
||||
{
|
||||
if (cargo_type == CT_INVALID) cargo_type = rvi->cargo_type;
|
||||
if (rvi->railveh_type == RAILVEH_WAGON) {
|
||||
if (!GetCargo(cargo_type)->is_freight) {
|
||||
if (parent_engine_type == INVALID_ENGINE) {
|
||||
scheme = LS_PASSENGER_WAGON_STEAM;
|
||||
} else {
|
||||
switch (RailVehInfo(parent_engine_type)->engclass) {
|
||||
default: NOT_REACHED();
|
||||
case EC_STEAM: scheme = LS_PASSENGER_WAGON_STEAM; break;
|
||||
case EC_DIESEL: scheme = LS_PASSENGER_WAGON_DIESEL; break;
|
||||
case EC_ELECTRIC: scheme = LS_PASSENGER_WAGON_ELECTRIC; break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
scheme = LS_FREIGHT_WAGON;
|
||||
}
|
||||
if (cargo_type == CT_INVALID) cargo_type = rvi->cargo_type;
|
||||
if (rvi->railveh_type == RAILVEH_WAGON) {
|
||||
if (!GetCargo(cargo_type)->is_freight) {
|
||||
if (parent_engine_type == INVALID_ENGINE) {
|
||||
scheme = LS_PASSENGER_WAGON_STEAM;
|
||||
} else {
|
||||
bool is_mu = HasBit(EngInfo(engine_type)->misc_flags, EF_RAIL_IS_MU);
|
||||
|
||||
switch (rvi->engclass) {
|
||||
switch (RailVehInfo(parent_engine_type)->engclass) {
|
||||
default: NOT_REACHED();
|
||||
case EC_STEAM: scheme = LS_STEAM; break;
|
||||
case EC_DIESEL: scheme = is_mu ? LS_DMU : LS_DIESEL; break;
|
||||
case EC_ELECTRIC: scheme = is_mu ? LS_EMU : LS_ELECTRIC; break;
|
||||
case EC_STEAM: scheme = LS_PASSENGER_WAGON_STEAM; break;
|
||||
case EC_DIESEL: scheme = LS_PASSENGER_WAGON_DIESEL; break;
|
||||
case EC_ELECTRIC: scheme = LS_PASSENGER_WAGON_ELECTRIC; break;
|
||||
case EC_MONORAIL: scheme = LS_PASSENGER_WAGON_MONORAIL; break;
|
||||
case EC_MAGLEV: scheme = LS_PASSENGER_WAGON_MAGLEV; break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
scheme = LS_FREIGHT_WAGON;
|
||||
}
|
||||
} else {
|
||||
bool is_mu = HasBit(EngInfo(engine_type)->misc_flags, EF_RAIL_IS_MU);
|
||||
|
||||
case RAILTYPE_MONO: scheme = LS_MONORAIL; break;
|
||||
case RAILTYPE_MAGLEV: scheme = LS_MAGLEV; break;
|
||||
switch (rvi->engclass) {
|
||||
default: NOT_REACHED();
|
||||
case EC_STEAM: scheme = LS_STEAM; break;
|
||||
case EC_DIESEL: scheme = is_mu ? LS_DMU : LS_DIESEL; break;
|
||||
case EC_ELECTRIC: scheme = is_mu ? LS_EMU : LS_ELECTRIC; break;
|
||||
case EC_MONORAIL: scheme = LS_MONORAIL; break;
|
||||
case EC_MAGLEV: scheme = LS_MAGLEV; break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue