mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-17 21:25:40 +00:00
Extend vehicle running ticks to 16 bits to avoid overflow at day length > 3
This commit is contained in:
parent
1f148322fb
commit
7b567c9d26
@ -45,7 +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_VARIABLE_DAY_LENGTH, XSCF_NULL, 1, 1, "variable_day_length", NULL, NULL, NULL },
|
{ XSLFI_VARIABLE_DAY_LENGTH, XSCF_NULL, 2, 2, "variable_day_length", 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
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -625,7 +625,8 @@ const SaveLoad *GetVehicleDescription(VehicleType vt)
|
|||||||
|
|
||||||
SLE_VAR(Vehicle, day_counter, SLE_UINT8),
|
SLE_VAR(Vehicle, day_counter, SLE_UINT8),
|
||||||
SLE_VAR(Vehicle, tick_counter, SLE_UINT8),
|
SLE_VAR(Vehicle, tick_counter, SLE_UINT8),
|
||||||
SLE_CONDVAR(Vehicle, running_ticks, SLE_UINT8, 88, SL_MAX_VERSION),
|
SLE_CONDVAR_X(Vehicle, running_ticks, SLE_FILE_U8 | SLE_VAR_U16, 88, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_VARIABLE_DAY_LENGTH, 0, 1)),
|
||||||
|
SLE_CONDVAR_X(Vehicle, running_ticks, SLE_UINT16, 88, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_VARIABLE_DAY_LENGTH, 2)),
|
||||||
|
|
||||||
SLE_VAR(Vehicle, cur_implicit_order_index, SLE_UINT8),
|
SLE_VAR(Vehicle, cur_implicit_order_index, SLE_UINT8),
|
||||||
SLE_CONDVAR(Vehicle, cur_real_order_index, SLE_UINT8, 158, SL_MAX_VERSION),
|
SLE_CONDVAR(Vehicle, cur_real_order_index, SLE_UINT8, 158, SL_MAX_VERSION),
|
||||||
|
@ -311,7 +311,7 @@ public:
|
|||||||
|
|
||||||
byte day_counter; ///< Increased by one for each day
|
byte day_counter; ///< Increased by one for each day
|
||||||
byte tick_counter; ///< Increased by one for each tick
|
byte tick_counter; ///< Increased by one for each tick
|
||||||
byte running_ticks; ///< Number of ticks this vehicle was not stopped this day
|
uint16 running_ticks; ///< Number of ticks this vehicle was not stopped this day
|
||||||
|
|
||||||
byte vehstatus; ///< Status
|
byte vehstatus; ///< Status
|
||||||
Order current_order; ///< The current order (+ status, like: loading)
|
Order current_order; ///< The current order (+ status, like: loading)
|
||||||
|
Loading…
Reference in New Issue
Block a user