summaryrefslogtreecommitdiff
path: root/order.h
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2006-08-26 16:34:03 +0000
committertruelight <truelight@openttd.org>2006-08-26 16:34:03 +0000
commit65f5ec13f678b98686abc8e599fc87adc81c5d26 (patch)
tree7f558c2b1487df44a464aa980693e44cb438c592 /order.h
parent4d43389c286f5ea2eccface64ef7b9afc5647ebc (diff)
downloadopenttd-65f5ec13f678b98686abc8e599fc87adc81c5d26.tar.xz
(svn r6142) -Codechange: added WaypointID (sorry DV, couldn't splits it anymore)
-Codechange: introduced DestinationID, which is in fact an union of several types Used in Order struct, so no longer StationID is abused for all targets. Hangars are a big exception, as they use a station-id with GOTO_DEPOT (go figure)
Diffstat (limited to 'order.h')
-rw-r--r--order.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/order.h b/order.h
index 508b7dd11..32d5b30dd 100644
--- a/order.h
+++ b/order.h
@@ -70,7 +70,6 @@ enum {
CO_UNSHARE = 2
};
-
/* If you change this, keep in mind that it is saved on 3 places:
* - Load_ORDR, all the global orders
* - Vehicle -> current_order
@@ -79,7 +78,7 @@ enum {
typedef struct Order {
OrderType type;
uint8 flags;
- StationID station;
+ DestinationID dest; ///< The destionation of the order.
struct Order *next; ///< Pointer to next order. If NULL, end of list
@@ -172,7 +171,7 @@ static inline bool IsOrderPoolFull(void)
static inline uint32 PackOrder(const Order *order)
{
- return order->station << 16 | order->flags << 8 | order->type;
+ return order->dest.station << 16 | order->flags << 8 | order->type;
}
static inline Order UnpackOrder(uint32 packed)
@@ -180,7 +179,7 @@ static inline Order UnpackOrder(uint32 packed)
Order order;
order.type = (OrderType)GB(packed, 0, 8);
order.flags = GB(packed, 8, 8);
- order.station = GB(packed, 16, 16);
+ order.dest.station = GB(packed, 16, 16);
order.next = NULL;
order.index = 0; // avoid compiler warning
return order;
@@ -189,7 +188,7 @@ static inline Order UnpackOrder(uint32 packed)
/* Functions */
void BackupVehicleOrders(const Vehicle *v, BackuppedOrders *order);
void RestoreVehicleOrders(const Vehicle* v, const BackuppedOrders* order);
-void RemoveOrderFromAllVehicles(OrderType type, StationID destination);
+void RemoveOrderFromAllVehicles(OrderType type, DestinationID destination);
void InvalidateVehicleOrder(const Vehicle *v);
bool VehicleHasDepotOrders(const Vehicle *v);
void CheckOrders(const Vehicle*);