Implement critical breakdown speed reduction for road vehicles

This commit is contained in:
Jonathan G Rennison
2018-01-04 19:18:24 +00:00
parent beda7ebb39
commit 0a80aec634
8 changed files with 42 additions and 6 deletions

View File

@@ -97,6 +97,8 @@ struct RoadVehicle FINAL : public GroundVehicle<RoadVehicle, VEH_ROAD> {
RoadType roadtype;
RoadTypes compatible_roadtypes;
byte critical_breakdown_count; ///< Counter for the number of critical breakdowns since last service
/** We don't want GCC to zero our struct! It already is zeroed and has an index! */
RoadVehicle() : GroundVehicleBase() {}
/** We want to 'destruct' the right class. */
@@ -124,6 +126,8 @@ struct RoadVehicle FINAL : public GroundVehicle<RoadVehicle, VEH_ROAD> {
bool IsBus() const;
int GetCurrentMaxSpeed() const;
int GetEffectiveMaxSpeed() const;
int GetDisplayEffectiveMaxSpeed() const { return this->GetEffectiveMaxSpeed() / 2; }
int UpdateSpeed();
protected: // These functions should not be called outside acceleration code.