From 3e3049fd0e4414225d640a379b894ac72cb119c1 Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Sat, 19 Jun 2021 11:18:30 +0200 Subject: [PATCH] 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. --- src/saveload/company_sl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/saveload/company_sl.cpp b/src/saveload/company_sl.cpp index 27fb2cf375..0738688653 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];