summaryrefslogtreecommitdiff
path: root/src/train.h
diff options
context:
space:
mode:
authorterkhen <terkhen@openttd.org>2010-03-06 12:52:44 +0000
committerterkhen <terkhen@openttd.org>2010-03-06 12:52:44 +0000
commita5f9a7c1a5fc09b6e996bd5448c94df2ab24b272 (patch)
treea468148d357a5386f4dba974ec89a2e74062805c /src/train.h
parent4e6cac84d6d30ea07fe7035f76085f8b0b55df78 (diff)
downloadopenttd-a5f9a7c1a5fc09b6e996bd5448c94df2ab24b272.tar.xz
(svn r19342) -Codechange: Move inclination update functions to GroundVehicle.
Diffstat (limited to 'src/train.h')
-rw-r--r--src/train.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/train.h b/src/train.h
index 71724c2c3..b21900ece 100644
--- a/src/train.h
+++ b/src/train.h
@@ -483,6 +483,16 @@ protected: // These functions should not be called outside acceleration code.
{
return GetRailTypeInfo(GetRailType(this->tile))->max_speed;
}
+
+ /**
+ * Checks if the vehicle is at a tile that can be sloped.
+ * @return True if the tile can be sloped.
+ */
+ FORCEINLINE bool TileMayHaveSlopedTrack() const
+ {
+ /* Any track that isn't TRACK_BIT_X or TRACK_BIT_Y cannot be sloped. */
+ return this->track == TRACK_BIT_X || this->track == TRACK_BIT_Y;
+ }
};
#define FOR_ALL_TRAINS(var) FOR_ALL_VEHICLES_OF_TYPE(Train, var)