diff options
Diffstat (limited to 'src/train.h')
-rw-r--r-- | src/train.h | 10 |
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) |