summaryrefslogtreecommitdiff
path: root/order.h
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2006-08-26 14:22:54 +0000
committertruelight <truelight@openttd.org>2006-08-26 14:22:54 +0000
commit602c0d40b38c83e520667ec1585b7745278fbbf8 (patch)
tree3ffa0a94034a5993e48411c7cb9b2cb765c6b1de /order.h
parentbe737b80d35aebf98a7fb571b1124cd51b371953 (diff)
downloadopenttd-602c0d40b38c83e520667ec1585b7745278fbbf8.tar.xz
(svn r6137) -Codechange: some very minor cleanups:
- Start using DeleteXXX for every pool item, not manually doing it - Use some wrapper to improve logic - Rewrote some pieces to improve logic
Diffstat (limited to 'order.h')
-rw-r--r--order.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/order.h b/order.h
index bf96e92ee..508b7dd11 100644
--- a/order.h
+++ b/order.h
@@ -135,6 +135,12 @@ static inline bool IsValidOrder(const Order *o)
return o->type != OT_NOTHING;
}
+static inline void DeleteOrder(Order *o)
+{
+ o->type = OT_NOTHING;
+ o->next = NULL;
+}
+
#define FOR_ALL_ORDERS_FROM(order, start) for (order = GetOrder(start); order != NULL; order = (order->index + 1 < GetOrderPoolSize()) ? GetOrder(order->index + 1) : NULL) if (IsValidOrder(order))
#define FOR_ALL_ORDERS(order) FOR_ALL_ORDERS_FROM(order, 0)