diff options
author | truelight <truelight@openttd.org> | 2006-08-26 16:34:03 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2006-08-26 16:34:03 +0000 |
commit | db8dfcd6e90f13ed0aafec06fc5975967afb1bb5 (patch) | |
tree | 7f558c2b1487df44a464aa980693e44cb438c592 /order.h | |
parent | f73a2829f364b07d6f944b8b49e156b9774db39b (diff) | |
download | openttd-db8dfcd6e90f13ed0aafec06fc5975967afb1bb5.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.h | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -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*); |