(svn r19342) -Codechange: Move inclination update functions to GroundVehicle.

This commit is contained in:
terkhen
2010-03-06 12:52:44 +00:00
parent 4e6cac84d6
commit a5f9a7c1a5
3 changed files with 51 additions and 34 deletions

View File

@@ -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)