Allow articulated road vehicles to overtake other vehicles

Add setting
This commit is contained in:
Jonathan G Rennison
2019-04-27 13:56:49 +01:00
parent c84a8c14b4
commit a6ea1ea408
8 changed files with 66 additions and 16 deletions

View File

@@ -166,6 +166,18 @@ struct RoadVehicle FINAL : public GroundVehicle<RoadVehicle, VEH_ROAD> {
return !this->IsRoadVehicleOnLevelCrossing();
}
inline uint GetOvertakingCounterThreshold() const
{
return RV_OVERTAKE_TIMEOUT + (this->gcache.cached_total_length / 2) - (VEHICLE_LENGTH / 2);
}
inline void SetRoadVehicleOvertaking(byte overtaking)
{
for (RoadVehicle *u = this; u != nullptr; u = u->Next()) {
u->overtaking = overtaking;
}
}
protected: // These functions should not be called outside acceleration code.
/**