Import vehicle lifetime profit patch v3

http://www.tt-forums.net/viewtopic.php?p=1161735#p1161735
This commit is contained in:
patch-import
2016-01-01 13:35:26 +00:00
committed by Jonathan G Rennison
parent 137ecd5377
commit 71be17729e
7 changed files with 29 additions and 2 deletions

View File

@@ -2975,6 +2975,12 @@ bool AfterLoadGame()
FOR_ALL_STATIONS(st) UpdateStationAcceptance(st, false);
}
/* Set lifetime vehicle profit to 0 if save game before 195 */
if (IsSavegameVersionBefore(195)) {
Vehicle *v;
FOR_ALL_VEHICLES(v) v->profit_lifetime = 0;
}
/* Road stops is 'only' updating some caches */
AfterLoadRoadStops();
AfterLoadLabelMaps();

View File

@@ -263,7 +263,7 @@
* 193 26802
* 194 26881 1.5.x
*/
extern const uint16 SAVEGAME_VERSION = 194; ///< Current savegame version of OpenTTD.
extern const uint16 SAVEGAME_VERSION = 195; ///< Current savegame version of OpenTTD.
SavegameType _savegame_type; ///< type of savegame we are loading

View File

@@ -683,6 +683,7 @@ const SaveLoad *GetVehicleDescription(VehicleType vt)
SLE_CONDVAR(Vehicle, profit_this_year, SLE_INT64, 65, SL_MAX_VERSION),
SLE_CONDVAR(Vehicle, profit_last_year, SLE_FILE_I32 | SLE_VAR_I64, 0, 64),
SLE_CONDVAR(Vehicle, profit_last_year, SLE_INT64, 65, SL_MAX_VERSION),
SLE_CONDVAR(Vehicle, profit_lifetime, SLE_INT64, 195, SL_MAX_VERSION),
SLEG_CONDVAR( _cargo_feeder_share, SLE_FILE_I32 | SLE_VAR_I64, 51, 64),
SLEG_CONDVAR( _cargo_feeder_share, SLE_INT64, 65, 67),
SLEG_CONDVAR( _cargo_loaded_at_xy, SLE_UINT32, 51, 67),