1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-27 06:04:25 +01:00

Fix 568b70e: Fjordia SlCompanyLiveries::Load crash (#15148)

Co-authored-by: qirlib <qirlib@gmail.com>
This commit is contained in:
Peter Nelson
2026-01-22 22:59:20 +00:00
committed by GitHub
parent 9545d255ce
commit df7bf03cc8

View File

@@ -456,7 +456,7 @@ public:
if (IsSavegameVersionBefore(SLV_85)) {
/* We want to insert some liveries somewhere in between. This means some have to be moved. */
std::move_backward(&c->livery[LS_FREIGHT_WAGON - 2], &c->livery[LS_END - 2], &c->livery[LS_END]);
std::move_backward(std::begin(c->livery) + LS_FREIGHT_WAGON - 2, std::end(c->livery) - 2, std::end(c->livery));
c->livery[LS_PASSENGER_WAGON_MONORAIL] = c->livery[LS_MONORAIL];
c->livery[LS_PASSENGER_WAGON_MAGLEV] = c->livery[LS_MAGLEV];
}