Add train cache flag for whether train using realistic braking physics

This commit is contained in:
Jonathan G Rennison
2021-04-15 19:39:36 +01:00
parent b514d29db1
commit ba2e6087b2
8 changed files with 30 additions and 20 deletions

View File

@@ -97,6 +97,7 @@ inline int GetTrainRealisticBrakingTargetDecelerationLimit(int acceleration_type
enum TrainCacheFlags : byte {
TCF_NONE = 0, ///< No flags
TCF_TILT = 0x01, ///< Train can tilt; feature provides a bonus in curves.
TCF_RL_BRAKING = 0x02, ///< Train realistic braking (movement physics) in effect for this vehicle
};
DECLARE_ENUM_AS_BIT_SET(TrainCacheFlags)
@@ -204,6 +205,8 @@ public:
int GetCurrentMaxSpeed() const;
bool UsingRealisticBraking() const { return this->tcache.cached_tflags & TCF_RL_BRAKING; }
/**
* Get the next real (non-articulated part and non rear part of dualheaded engine) vehicle in the consist.
* @return Next vehicle in the consist.