summaryrefslogtreecommitdiff
path: root/src/train.h
diff options
context:
space:
mode:
authorterkhen <terkhen@openttd.org>2010-01-28 20:54:29 +0000
committerterkhen <terkhen@openttd.org>2010-01-28 20:54:29 +0000
commitd4376779f843b1310a3e0c9a527f1a23698954ab (patch)
treefb14ad6b5ce1729913417f243ab98ac9d07966d3 /src/train.h
parent294bc146522ea305745889f123ed7debf8364f5d (diff)
downloadopenttd-d4376779f843b1310a3e0c9a527f1a23698954ab.tar.xz
(svn r18939) -Codechange [FS#3545]: Move train slope steepness to its own function.
Diffstat (limited to 'src/train.h')
-rw-r--r--src/train.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/train.h b/src/train.h
index f61febf0c..d7b583ee3 100644
--- a/src/train.h
+++ b/src/train.h
@@ -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)