diff options
author | rubidium <rubidium@openttd.org> | 2013-02-17 14:54:50 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2013-02-17 14:54:50 +0000 |
commit | cdb0a7695820ac088df6736cb59ac9989f945c8e (patch) | |
tree | 4eb4c9a8818a518622d32c3599c1c3e285dafdbe /src/saveload | |
parent | 446d50f6580d6d71ac30d6d64b72cb3e5c4c3aaa (diff) | |
download | openttd-cdb0a7695820ac088df6736cb59ac9989f945c8e.tar.xz |
(svn r25012) -Codechange: persistently keep 'reserved' cargo (for full-load improved loading) instead of calculating if for every cycle
Diffstat (limited to 'src/saveload')
-rw-r--r-- | src/saveload/cargopacket_sl.cpp | 5 | ||||
-rw-r--r-- | src/saveload/saveload.cpp | 3 | ||||
-rw-r--r-- | src/saveload/station_sl.cpp | 2 | ||||
-rw-r--r-- | src/saveload/vehicle_sl.cpp | 1 |
4 files changed, 9 insertions, 2 deletions
diff --git a/src/saveload/cargopacket_sl.cpp b/src/saveload/cargopacket_sl.cpp index 092301e95..f9ebd3408 100644 --- a/src/saveload/cargopacket_sl.cpp +++ b/src/saveload/cargopacket_sl.cpp @@ -77,6 +77,11 @@ for (CargoID c = 0; c < NUM_CARGO; c++) st->goods[c].cargo.InvalidateCache(); } } + + if (IsSavegameVersionBefore(181)) { + Vehicle *v; + FOR_ALL_VEHICLES(v) v->cargo.KeepAll(); + } } /** diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp index a21f6242a..a15a4a160 100644 --- a/src/saveload/saveload.cpp +++ b/src/saveload/saveload.cpp @@ -244,8 +244,9 @@ * 178 24789 * 179 24810 * 180 24998 + * 181 25012 */ -extern const uint16 SAVEGAME_VERSION = 180; ///< Current savegame version of OpenTTD. +extern const uint16 SAVEGAME_VERSION = 181; ///< Current savegame version of OpenTTD. SavegameType _savegame_type; ///< type of savegame we are loading diff --git a/src/saveload/station_sl.cpp b/src/saveload/station_sl.cpp index 9feb1f274..b1ef9bbe7 100644 --- a/src/saveload/station_sl.cpp +++ b/src/saveload/station_sl.cpp @@ -259,7 +259,7 @@ const SaveLoad *GetGoodsDesc() SLEG_CONDVAR( _cargo_feeder_share, SLE_INT64, 65, 67), SLE_CONDVAR(GoodsEntry, amount_fract, SLE_UINT8, 150, SL_MAX_VERSION), SLE_CONDLST(GoodsEntry, cargo.packets, REF_CARGO_PACKET, 68, SL_MAX_VERSION), - + SLE_CONDVAR(GoodsEntry, cargo.reserved_count,SLE_UINT, 181, SL_MAX_VERSION), SLE_END() }; diff --git a/src/saveload/vehicle_sl.cpp b/src/saveload/vehicle_sl.cpp index a33ceb6d3..fe2fdba06 100644 --- a/src/saveload/vehicle_sl.cpp +++ b/src/saveload/vehicle_sl.cpp @@ -614,6 +614,7 @@ const SaveLoad *GetVehicleDescription(VehicleType vt) SLE_VAR(Vehicle, cargo_cap, SLE_UINT16), SLEG_CONDVAR( _cargo_count, SLE_UINT16, 0, 67), SLE_CONDLST(Vehicle, cargo.packets, REF_CARGO_PACKET, 68, SL_MAX_VERSION), + SLE_CONDARR(Vehicle, cargo.action_counts, SLE_UINT, VehicleCargoList::NUM_MOVE_TO_ACTION, 181, SL_MAX_VERSION), SLE_CONDVAR(Vehicle, cargo_age_counter, SLE_UINT16, 162, SL_MAX_VERSION), SLE_VAR(Vehicle, day_counter, SLE_UINT8), |