diff options
author | rubidium <rubidium@openttd.org> | 2009-10-06 17:23:15 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-10-06 17:23:15 +0000 |
commit | 5f59d0c5b4e85a3bb51936fa05b2c5493f571eca (patch) | |
tree | ca2af53f7c2c4af662725813b62d480a3748954d /src/saveload/station_sl.cpp | |
parent | a4835e3f0b8c0d4f330fc8e91bdd529af60cc7a3 (diff) | |
download | openttd-5f59d0c5b4e85a3bb51936fa05b2c5493f571eca.tar.xz |
(svn r17720) -Codechange: guard the CargoPacket variables that are cached in CargoLists so they cannot be written from outside the CargoList class (based on patch by fonsinchen)
Diffstat (limited to 'src/saveload/station_sl.cpp')
-rw-r--r-- | src/saveload/station_sl.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/saveload/station_sl.cpp b/src/saveload/station_sl.cpp index 5ddb9f69f..5e11c04c5 100644 --- a/src/saveload/station_sl.cpp +++ b/src/saveload/station_sl.cpp @@ -239,15 +239,10 @@ static void Load_STNS() 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(); + 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->count = GB(_waiting_acceptance, 0, 12); - cp->days_in_transit = _cargo_days; - cp->feeder_share = _cargo_feeder_share; cp->source_xy = _cargo_source_xy; - cp->days_in_transit = _cargo_days; - cp->feeder_share = _cargo_feeder_share; SB(ge->acceptance_pickup, GoodsEntry::PICKUP, 1, 1); ge->cargo.Append(cp); } |