summaryrefslogtreecommitdiff
path: root/order.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-07-20 15:29:28 +0000
committertron <tron@openttd.org>2005-07-20 15:29:28 +0000
commitac66e3e28f35c6939d3af68d1f0e26eb9b34e377 (patch)
treea82679a91beaee405777f0f3c5e3c45814f1ea5d /order.h
parentf432314fa907d4f3ee63537d399bad64a35033bd (diff)
downloadopenttd-ac66e3e28f35c6939d3af68d1f0e26eb9b34e377.tar.xz
(svn r2650) Convert many explicit shifts+ands to extract bits to invocations of GB - should be a bit nicer to read
Diffstat (limited to 'order.h')
-rw-r--r--order.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/order.h b/order.h
index 79a66cf6e..1b0bdd18a 100644
--- a/order.h
+++ b/order.h
@@ -135,9 +135,9 @@ static inline uint32 PackOrder(const Order *order)
static inline Order UnpackOrder(uint32 packed)
{
Order order;
- order.type = (packed & 0x000000FF);
- order.flags = (packed & 0x0000FF00) >> 8;
- order.station = (packed & 0xFFFF0000) >> 16;
+ order.type = GB(packed, 0, 8);
+ order.flags = GB(packed, 8, 8);
+ order.station = GB(packed, 16, 16);
order.next = NULL;
order.index = 0; // avoid compiler warning
return order;