From 766bf140db3f8a69b46234711c653ee1aba94341 Mon Sep 17 00:00:00 2001 From: terkhen Date: Sat, 6 Nov 2010 12:40:38 +0000 Subject: [PATCH] (svn r21092) -Codechange: Merge max speed functions. --- src/ground_vehicle.cpp | 2 +- src/ground_vehicle.hpp | 2 +- src/roadveh.h | 10 ---------- src/train.h | 9 --------- 4 files changed, 2 insertions(+), 21 deletions(-) diff --git a/src/ground_vehicle.cpp b/src/ground_vehicle.cpp index b3f2002002..f3ba7d7756 100644 --- a/src/ground_vehicle.cpp +++ b/src/ground_vehicle.cpp @@ -27,7 +27,7 @@ void GroundVehicle::PowerChanged() uint32 total_power = 0; uint32 max_te = 0; uint32 number_of_parts = 0; - uint16 max_track_speed = v->GetInitialMaxSpeed(); + uint16 max_track_speed = v->GetDisplayMaxSpeed(); for (const T *u = v; u != NULL; u = u->Next()) { uint32 current_power = u->GetPower(); diff --git a/src/ground_vehicle.hpp b/src/ground_vehicle.hpp index 2e748bda45..77822abc9c 100644 --- a/src/ground_vehicle.hpp +++ b/src/ground_vehicle.hpp @@ -61,7 +61,7 @@ enum GroundVehicleFlags { * virtual uint32 GetRollingFriction() const = 0; * virtual int GetAccelerationType() const = 0; * virtual int32 GetSlopeSteepness() const = 0; - * virtual uint16 GetInitialMaxSpeed() const = 0; + * virtual int GetDisplayMaxSpeed() const = 0; * virtual uint16 GetMaxTrackSpeed() const = 0; * virtual bool TileMayHaveSlopedTrack() const = 0; */ diff --git a/src/roadveh.h b/src/roadveh.h index 8a424dd344..a8fcccd001 100644 --- a/src/roadveh.h +++ b/src/roadveh.h @@ -279,16 +279,6 @@ protected: // These functions should not be called outside acceleration code. return 20 * _settings_game.vehicle.roadveh_slope_steepness; // 1% slope * slope steepness } - /** - * Gets the maximum speed of the vehicle, ignoring the limitations of the kind of track the vehicle is on. - * @return Maximum speed of the vehicle. - */ - FORCEINLINE uint16 GetInitialMaxSpeed() const - { - /* Road vehicles use a *2 conversion factor. */ - return this->max_speed / 2; - } - /** * Gets the maximum speed allowed by the track for this vehicle. * @return Since roads don't limit road vehicle speed, it returns always zero. diff --git a/src/train.h b/src/train.h index 8b2d619ac2..c1dd3af24a 100644 --- a/src/train.h +++ b/src/train.h @@ -500,15 +500,6 @@ protected: // These functions should not be called outside acceleration code. return 20 * _settings_game.vehicle.train_slope_steepness; // 1% slope * slope steepness } - /** - * Gets the maximum speed of the vehicle, ignoring the limitations of the kind of track the vehicle is on. - * @return Maximum speed of the vehicle. - */ - FORCEINLINE uint16 GetInitialMaxSpeed() const - { - return this->tcache.cached_max_speed; - } - /** * Gets the maximum speed allowed by the track for this vehicle. * @return Maximum speed allowed.