(svn r25012) -Codechange: persistently keep 'reserved' cargo (for full-load improved loading) instead of calculating if for every cycle

This commit is contained in:
rubidium
2013-02-17 14:54:50 +00:00
parent c62cbe04a4
commit 7dd2354a13
12 changed files with 614 additions and 335 deletions

View File

@@ -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();
}
}
/**

View File

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

View File

@@ -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()
};

View File

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