From ecfaa0564d9588b9f6826b1033d93b827751f410 Mon Sep 17 00:00:00 2001 From: smatz Date: Wed, 1 Jul 2009 23:49:13 +0000 Subject: (svn r16718) -Codechange: make IsFreeWagon() member of Train --- src/train.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/train.h') 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 { 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) -- cgit v1.2.3-54-g00ecf