mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r20302) -Add: Method for getting the air drag of a ground vehicle.
This commit is contained in:
parent
8203749e68
commit
7d0297f967
|
@ -54,6 +54,7 @@ enum GroundVehicleFlags {
|
|||
* virtual uint16 GetPoweredPartPower(const T *head) const = 0;
|
||||
* virtual uint16 GetWeight() const = 0;
|
||||
* virtual byte GetTractiveEffort() const = 0;
|
||||
* virtual byte GetAirDrag() const = 0;
|
||||
* virtual byte GetAirDragArea() const = 0;
|
||||
* virtual AccelStatus GetAccelerationStatus() const = 0;
|
||||
* virtual uint16 GetCurrentSpeed() const = 0;
|
||||
|
|
|
@ -219,6 +219,15 @@ protected: // These functions should not be called outside acceleration code.
|
|||
return 60;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the air drag coefficient of this vehicle.
|
||||
* @return Air drag value from the engine.
|
||||
*/
|
||||
FORCEINLINE byte GetAirDrag() const
|
||||
{
|
||||
return RoadVehInfo(this->engine_type)->air_drag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the current acceleration status of this vehicle.
|
||||
* @return Acceleration status.
|
||||
|
|
|
@ -441,6 +441,15 @@ protected: // These functions should not be called outside acceleration code.
|
|||
return 120;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the air drag coefficient of this vehicle.
|
||||
* @return Air drag value from the engine.
|
||||
*/
|
||||
FORCEINLINE byte GetAirDrag() const
|
||||
{
|
||||
return RailVehInfo(this->engine_type)->air_drag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the current acceleration status of this vehicle.
|
||||
* @return Acceleration status.
|
||||
|
|
Loading…
Reference in New Issue