Save/load changes for veh lifetime profit patch.
This commit is contained in:
@@ -2975,8 +2975,8 @@ bool AfterLoadGame()
|
|||||||
FOR_ALL_STATIONS(st) UpdateStationAcceptance(st, false);
|
FOR_ALL_STATIONS(st) UpdateStationAcceptance(st, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set lifetime vehicle profit to 0 if save game before 195 */
|
/* Set lifetime vehicle profit to 0 if lifetime profit feature is missing */
|
||||||
if (IsSavegameVersionBefore(195)) {
|
if (SlXvIsFeatureMissing(XSLFI_VEH_LIFETIME_PROFIT)) {
|
||||||
Vehicle *v;
|
Vehicle *v;
|
||||||
FOR_ALL_VEHICLES(v) v->profit_lifetime = 0;
|
FOR_ALL_VEHICLES(v) v->profit_lifetime = 0;
|
||||||
}
|
}
|
||||||
|
@@ -45,6 +45,7 @@ std::vector<uint32> _sl_xv_discardable_chunk_ids; ///< list of chunks
|
|||||||
static const uint32 _sl_xv_slxi_chunk_version = 0; ///< current version os SLXI chunk
|
static const uint32 _sl_xv_slxi_chunk_version = 0; ///< current version os SLXI chunk
|
||||||
|
|
||||||
const SlxiSubChunkInfo _sl_xv_sub_chunk_infos[] = {
|
const SlxiSubChunkInfo _sl_xv_sub_chunk_infos[] = {
|
||||||
|
{ XSLFI_VEH_LIFETIME_PROFIT, XSCF_NULL, 1, 1, "veh_lifetime_profit", NULL, NULL, NULL },
|
||||||
{ XSLFI_NULL, XSCF_NULL, 0, 0, NULL, NULL, NULL, NULL },// This is the end marker
|
{ XSLFI_NULL, XSCF_NULL, 0, 0, NULL, NULL, NULL, NULL },// This is the end marker
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -21,6 +21,7 @@
|
|||||||
*/
|
*/
|
||||||
enum SlXvFeatureIndex {
|
enum SlXvFeatureIndex {
|
||||||
XSLFI_NULL = 0, ///< Unused value, to indicate that no extended feature test is in use
|
XSLFI_NULL = 0, ///< Unused value, to indicate that no extended feature test is in use
|
||||||
|
XSLFI_VEH_LIFETIME_PROFIT, ///< Vehicle lifetime profit patch
|
||||||
|
|
||||||
XSLFI_SIZE, ///< Total count of features, including null feature
|
XSLFI_SIZE, ///< Total count of features, including null feature
|
||||||
};
|
};
|
||||||
|
@@ -683,7 +683,7 @@ const SaveLoad *GetVehicleDescription(VehicleType vt)
|
|||||||
SLE_CONDVAR(Vehicle, profit_this_year, SLE_INT64, 65, SL_MAX_VERSION),
|
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_FILE_I32 | SLE_VAR_I64, 0, 64),
|
||||||
SLE_CONDVAR(Vehicle, profit_last_year, SLE_INT64, 65, SL_MAX_VERSION),
|
SLE_CONDVAR(Vehicle, profit_last_year, SLE_INT64, 65, SL_MAX_VERSION),
|
||||||
SLE_CONDVAR(Vehicle, profit_lifetime, SLE_INT64, 195, SL_MAX_VERSION),
|
SLE_CONDVAR_X(Vehicle,profit_lifetime, SLE_INT64, 0, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_VEH_LIFETIME_PROFIT)),
|
||||||
SLEG_CONDVAR( _cargo_feeder_share, SLE_FILE_I32 | SLE_VAR_I64, 51, 64),
|
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_feeder_share, SLE_INT64, 65, 67),
|
||||||
SLEG_CONDVAR( _cargo_loaded_at_xy, SLE_UINT32, 51, 67),
|
SLEG_CONDVAR( _cargo_loaded_at_xy, SLE_UINT32, 51, 67),
|
||||||
|
Reference in New Issue
Block a user