summaryrefslogtreecommitdiff
path: root/src/train.h
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-07-01 23:49:13 +0000
committersmatz <smatz@openttd.org>2009-07-01 23:49:13 +0000
commitecfaa0564d9588b9f6826b1033d93b827751f410 (patch)
treef04dff76baabb0dcc7e952f9d81b70828398a740 /src/train.h
parentadc5363202629aa07c762f459d7e9f5bc78efa34 (diff)
downloadopenttd-ecfaa0564d9588b9f6826b1033d93b827751f410.tar.xz
(svn r16718) -Codechange: make IsFreeWagon() member of Train
Diffstat (limited to 'src/train.h')
-rw-r--r--src/train.h11
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)