forked from mirror/OpenTTD
(svn r6353) -Codechange: Make DestinationID a typedef of uin16, which is as large as any type of destinataion (StationID, DepotID, WaypointID) it can hold
DestinationID being a union of these types is just hassle without benefit and cannot be handled correctly everywhere because of local lack of information
This commit is contained in:
4
order.h
4
order.h
@@ -177,7 +177,7 @@ static inline bool IsOrderPoolFull(void)
|
||||
|
||||
static inline uint32 PackOrder(const Order *order)
|
||||
{
|
||||
return order->dest.station << 16 | order->flags << 8 | order->type;
|
||||
return order->dest << 16 | order->flags << 8 | order->type;
|
||||
}
|
||||
|
||||
static inline Order UnpackOrder(uint32 packed)
|
||||
@@ -185,7 +185,7 @@ static inline Order UnpackOrder(uint32 packed)
|
||||
Order order;
|
||||
order.type = (OrderType)GB(packed, 0, 8);
|
||||
order.flags = GB(packed, 8, 8);
|
||||
order.dest.station = GB(packed, 16, 16);
|
||||
order.dest = GB(packed, 16, 16);
|
||||
order.next = NULL;
|
||||
order.index = 0; // avoid compiler warning
|
||||
return order;
|
||||
|
Reference in New Issue
Block a user