src/train.h
changeset 8022 32b885de2410
parent 7988 6075538f6111
child 8023 67fdef8a686e
--- a/src/train.h	Wed Sep 05 09:31:15 2007 +0000
+++ b/src/train.h	Wed Sep 05 10:15:23 2007 +0000
@@ -225,6 +225,16 @@
 	return v;
 }
 
+/** Tell if we are dealing with the rear end of a multiheaded engine.
+ * @param v Vehicle.
+ * @return True if the engine is the rear part of a dualheaded engine.
+ */
+static inline bool IsRearDualheaded(const Vehicle *v)
+{
+	assert(v->type == VEH_TRAIN);
+	return (IsMultiheaded(v) && !IsTrainEngine(v));
+}
+
 /** Get the next real (non-articulated part) vehicle in the consist.
  * @param v Vehicle.
  * @return Next vehicle in the consist.