summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-06-19 11:18:30 +0200
committerPatric Stout <github@truebrain.nl>2021-07-02 22:21:58 +0200
commit3e3049fd0e4414225d640a379b894ac72cb119c1 (patch)
tree6d55cafa3ad43c25a6784fc9a4ff02e1d374d51c
parent4e645ce749904f736ccf2b5b9d400240ea420833 (diff)
downloadopenttd-3e3049fd0e4414225d640a379b894ac72cb119c1.tar.xz
Codechange: make savegame-version checks more obvious in SlCompanyLiveries::Load
num_liveries indirectly contained the same information, but this makes reading these things pretty difficult. So use IsSavegameVersionBefore() like everywhere else instead.
-rw-r--r--src/saveload/company_sl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/saveload/company_sl.cpp b/src/saveload/company_sl.cpp
index 27fb2cf37..073868865 100644
--- a/src/saveload/company_sl.cpp
+++ b/src/saveload/company_sl.cpp
@@ -423,14 +423,14 @@ public:
}
}
- if (num_liveries < LS_END) {
+ if (IsSavegameVersionBefore(SLV_85)) {
/* We want to insert some liveries somewhere in between. This means some have to be moved. */
memmove(&c->livery[LS_FREIGHT_WAGON], &c->livery[LS_PASSENGER_WAGON_MONORAIL], (LS_END - LS_FREIGHT_WAGON) * sizeof(c->livery[0]));
c->livery[LS_PASSENGER_WAGON_MONORAIL] = c->livery[LS_MONORAIL];
c->livery[LS_PASSENGER_WAGON_MAGLEV] = c->livery[LS_MAGLEV];
}
- if (num_liveries == LS_END - 4) {
+ if (IsSavegameVersionBefore(SLV_63)) {
/* Copy bus/truck liveries over to trams */
c->livery[LS_PASSENGER_TRAM] = c->livery[LS_BUS];
c->livery[LS_FREIGHT_TRAM] = c->livery[LS_TRUCK];