diff --git a/src/ground_vehicle.cpp b/src/ground_vehicle.cpp index 395f0c26b3..6ccba6aa75 100644 --- a/src/ground_vehicle.cpp +++ b/src/ground_vehicle.cpp @@ -107,7 +107,7 @@ int GroundVehicle::GetAcceleration() const bool maglev = v->GetAccelerationType() == 2; - const int area = 120; + const int area = v->GetAirDragArea(); if (!maglev) { resistance = (13 * mass) / 10; resistance += this->acc_cache.cached_axle_resistance; diff --git a/src/ground_vehicle.hpp b/src/ground_vehicle.hpp index 5be320d0fc..84930464d5 100644 --- a/src/ground_vehicle.hpp +++ b/src/ground_vehicle.hpp @@ -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 GetAirDragArea() const = 0; * virtual AccelStatus GetAccelerationStatus() const = 0; * virtual uint16 GetCurrentSpeed() const = 0; * virtual uint32 GetRollingFriction() const = 0; diff --git a/src/roadveh.h b/src/roadveh.h index 6af7425b42..5a5ee549ba 100644 --- a/src/roadveh.h +++ b/src/roadveh.h @@ -210,6 +210,15 @@ protected: // These functions should not be called outside acceleration code. return RoadVehInfo(this->engine_type)->tractive_effort; } + /** + * Gets the area used for calculating air drag. + * @return Area of the engine. + */ + FORCEINLINE byte GetAirDragArea() const + { + return 60; + } + /** * Checks the current acceleration status of this vehicle. * @return Acceleration status. diff --git a/src/train.h b/src/train.h index a43b0747cc..84bb88e30c 100644 --- a/src/train.h +++ b/src/train.h @@ -432,6 +432,15 @@ protected: // These functions should not be called outside acceleration code. return GetVehicleProperty(this, PROP_TRAIN_TRACTIVE_EFFORT, RailVehInfo(this->engine_type)->tractive_effort); } + /** + * Gets the area used for calculating air drag. + * @return Area of the engine. + */ + FORCEINLINE byte GetAirDragArea() const + { + return 120; + } + /** * Checks the current acceleration status of this vehicle. * @return Acceleration status.