diff options
author | smatz <smatz@openttd.org> | 2009-07-01 23:49:13 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2009-07-01 23:49:13 +0000 |
commit | ecfaa0564d9588b9f6826b1033d93b827751f410 (patch) | |
tree | f04dff76baabb0dcc7e952f9d81b70828398a740 /src/train.h | |
parent | adc5363202629aa07c762f459d7e9f5bc78efa34 (diff) | |
download | openttd-ecfaa0564d9588b9f6826b1033d93b827751f410.tar.xz |
(svn r16718) -Codechange: make IsFreeWagon() member of Train
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) |