1
0
Fork 0

Codechange: Re-order load update for SLV_139

It is no longer required to be performed before the first phase
of vehicle updates
pull/13005/head
Jonathan G Rennison 2024-07-01 17:09:05 +01:00 committed by rubidium42
parent f19829d029
commit 8ed983b3cd
1 changed files with 9 additions and 11 deletions

View File

@ -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) {