From df7bf03cc869e16f04f39637f00e3aae969d8f26 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Thu, 22 Jan 2026 22:59:20 +0000 Subject: [PATCH] Fix 568b70e: Fjordia SlCompanyLiveries::Load crash (#15148) Co-authored-by: qirlib --- src/saveload/company_sl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/saveload/company_sl.cpp b/src/saveload/company_sl.cpp index b72a695224..e811c5538f 100644 --- a/src/saveload/company_sl.cpp +++ b/src/saveload/company_sl.cpp @@ -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]; }