diff options
Diffstat (limited to 'src/train.h')
-rw-r--r-- | src/train.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/train.h b/src/train.h index 21e1995ea..02f73ffe6 100644 --- a/src/train.h +++ b/src/train.h @@ -327,11 +327,16 @@ struct Train : public SpecializedVehicle<Train, VEH_TRAIN> { bool FindClosestDepot(TileIndex *location, DestinationID *destination, bool *reverse); /** - * Check if a vehicle is front engine - * @param v vehicle to check - * @return Returns true if vehicle is a front engine + * Check if train is a front engine + * @return Returns true if train is a front engine */ FORCEINLINE bool IsFrontEngine() const { return HasBit(this->subtype, TS_FRONT); } + + /** + * Check if train is a free wagon (got no engine in front of it) + * @return Returns true if train is a free wagon + */ + FORCEINLINE bool IsFreeWagon() const { return HasBit(this->subtype, TS_FREE_WAGON); } }; #define FOR_ALL_TRAINS(var) FOR_ALL_VEHICLES_OF_TYPE(Train, var) |