(svn r12886) [NewGRF_ports] -Change: Added test for IsInFlight to detect if an aircraft is flying between airports, or is in the main body of the FSM.
--- a/src/aircraft.h Thu Apr 24 21:53:20 2008 +0000
+++ b/src/aircraft.h Fri Apr 25 01:39:33 2008 +0000
@@ -54,6 +54,17 @@
}
}
+/** Check if the aircraft is in flight between airports
+ * @param v vehicle to check
+ * @return Returns true if the aircraft is in flight
+ * false if it is any other state) */
+static inline bool IsInFlight(const Vehicle *v)
+{
+ assert(v->type == VEH_AIRCRAFT);
+ return ((v->u.air.pos == v->u.air.previous_pos) && v->u.air.state == FLYING);
+}
+
+
/** Checks if an aircraft can use the station in question
* @param engine The engine to test
* @param st The station