Realistic braking: Cache train overall z position

Refresh cache at a variable rate depending on train length and
weight distribution
This commit is contained in:
Jonathan G Rennison
2022-06-03 00:41:41 +01:00
parent c238bd5012
commit 99ee4b13ce
9 changed files with 57 additions and 16 deletions

View File

@@ -1392,6 +1392,8 @@ const SaveLoadTable GetVehicleLookAheadDescription()
SLE_VAR(TrainReservationLookAhead, flags, SLE_UINT16),
SLE_VAR(TrainReservationLookAhead, speed_restriction, SLE_UINT16),
SLE_CONDVAR_X(TrainReservationLookAhead, next_extend_position, SLE_INT32, SL_MIN_VERSION, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_REALISTIC_TRAIN_BRAKING, 5)),
SLE_CONDVAR_X(TrainReservationLookAhead, cached_zpos, SLE_INT32, SL_MIN_VERSION, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_REALISTIC_TRAIN_BRAKING, 6)),
SLE_CONDVAR_X(TrainReservationLookAhead, zpos_refresh_remaining, SLE_UINT8, SL_MIN_VERSION, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_REALISTIC_TRAIN_BRAKING, 6)),
};
return _vehicle_look_ahead_desc;