summaryrefslogtreecommitdiff
path: root/roadveh.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-06-05 10:23:18 +0000
committertron <tron@openttd.org>2006-06-05 10:23:18 +0000
commitd26e40ca7e405ffbba533242a085d3bde5506cf1 (patch)
tree35c744c702db39785503087f611946cf4470097d /roadveh.h
parent5dd68173c812e645cc3c2f15c6aeb6f2e35f3296 (diff)
downloadopenttd-d26e40ca7e405ffbba533242a085d3bde5506cf1.tar.xz
(svn r5118) Add IsRoadVehInDepot{Stopped,}()
Diffstat (limited to 'roadveh.h')
-rw-r--r--roadveh.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/roadveh.h b/roadveh.h
new file mode 100644
index 000000000..9d5800e6d
--- /dev/null
+++ b/roadveh.h
@@ -0,0 +1,15 @@
+/* $Id$ */
+
+#include "vehicle.h"
+
+
+static inline bool IsRoadVehInDepot(const Vehicle* v)
+{
+ assert(v->type == VEH_Road);
+ return v->u.road.state == 254;
+}
+
+static inline bool IsRoadVehInDepotStopped(const Vehicle* v)
+{
+ return IsRoadVehInDepot(v) && v->vehstatus & VS_STOPPED;
+}