(svn r18939) -Codechange [FS#3545]: Move train slope steepness to its own function.

This commit is contained in:
terkhen
2010-01-28 20:54:29 +00:00
parent 294bc14652
commit d4376779f8
2 changed files with 10 additions and 1 deletions

View File

@@ -494,6 +494,15 @@ protected: /* These functions should not be called outside acceleration code. */
{
return GetRailTypeInfo(this->railtype)->acceleration_type;
}
/**
* Returns the slope steepness used by this vehicle.
* @return Slope steepness used by the vehicle.
*/
FORCEINLINE uint32 GetSlopeSteepness() const
{
return 20 * _settings_game.vehicle.train_slope_steepness; // 1% slope * slope steepness
}
};
#define FOR_ALL_TRAINS(var) FOR_ALL_VEHICLES_OF_TYPE(Train, var)