summaryrefslogtreecommitdiff
path: root/src/saveload/station_sl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/saveload/station_sl.cpp')
-rw-r--r--src/saveload/station_sl.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/saveload/station_sl.cpp b/src/saveload/station_sl.cpp
index cce636046..b1cb2bed5 100644
--- a/src/saveload/station_sl.cpp
+++ b/src/saveload/station_sl.cpp
@@ -243,13 +243,12 @@ static void Load_STNS()
if (CheckSavegameVersion(68)) {
SB(ge->acceptance_pickup, GoodsEntry::ACCEPTANCE, 1, HasBit(_waiting_acceptance, 15));
if (GB(_waiting_acceptance, 0, 12) != 0) {
- /* Don't construct the packet with station here, because that'll fail with old savegames */
- CargoPacket *cp = new CargoPacket(GB(_waiting_acceptance, 0, 12), _cargo_days, _cargo_feeder_share);
/* In old versions, enroute_from used 0xFF as INVALID_STATION */
- cp->source = (CheckSavegameVersion(7) && _cargo_source == 0xFF) ? INVALID_STATION : _cargo_source;
- cp->source_xy = _cargo_source_xy;
+ StationID source = (CheckSavegameVersion(7) && _cargo_source == 0xFF) ? INVALID_STATION : _cargo_source;
+
+ /* Don't construct the packet with station here, because that'll fail with old savegames */
+ ge->cargo.Append(new CargoPacket(GB(_waiting_acceptance, 0, 12), _cargo_days, source, _cargo_source_xy, _cargo_source_xy, _cargo_feeder_share));
SB(ge->acceptance_pickup, GoodsEntry::PICKUP, 1, 1);
- ge->cargo.Append(cp);
}
}
}