Changeset - r16366:a095570a4cf8
[Not reviewed]
master
0 4 0
terkhen - 14 years ago 2010-11-06 12:40:38
terkhen@openttd.org
(svn r21092) -Codechange: Merge max speed functions.
4 files changed with 2 insertions and 21 deletions:
0 comments (0 inline, 0 general)
src/ground_vehicle.cpp
Show inline comments
 
@@ -27,7 +27,7 @@ void GroundVehicle<T, Type>::PowerChange
 
	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();
src/ground_vehicle.hpp
Show inline comments
 
@@ -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;
 
 */
src/roadveh.h
Show inline comments
 
@@ -280,16 +280,6 @@ protected: // These functions should not
 
	}
 

	
 
	/**
 
	 * 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.
 
	 */
src/train.h
Show inline comments
 
@@ -501,15 +501,6 @@ protected: // These functions should not
 
	}
 

	
 
	/**
 
	 * 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.
 
	 */
0 comments (0 inline, 0 general)