From 8ed983b3cd665c96d0ff4d59b155f9a0308a9c09 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Mon, 1 Jul 2024 17:09:05 +0100 Subject: [PATCH] Codechange: Re-order load update for SLV_139 It is no longer required to be performed before the first phase of vehicle updates --- src/saveload/afterload.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index 0744e1585f..78bea5302c 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -817,17 +817,6 @@ bool AfterLoadGame() * filled; and that could eventually lead to desyncs. */ CargoPacket::AfterLoad(); - /* Oilrig was moved from id 15 to 9. We have to do this conversion - * here as AfterLoadVehicles can check it indirectly via the newgrf - * code. */ - if (IsSavegameVersionBefore(SLV_139)) { - for (Station *st : Station::Iterate()) { - if (st->airport.tile != INVALID_TILE && st->airport.type == 15) { - st->airport.type = AT_OILRIG; - } - } - } - /* Update all vehicles: Phase 1 */ AfterLoadVehiclesPhase1(true); @@ -2393,6 +2382,15 @@ bool AfterLoadGame() } } + /* Oilrig was moved from id 15 to 9. */ + if (IsSavegameVersionBefore(SLV_139)) { + for (Station *st : Station::Iterate()) { + if (st->airport.tile != INVALID_TILE && st->airport.type == 15) { + st->airport.type = AT_OILRIG; + } + } + } + if (IsSavegameVersionBefore(SLV_140)) { for (Station *st : Station::Iterate()) { if (st->airport.tile != INVALID_TILE) {