diff options
author | yexo <yexo@openttd.org> | 2009-06-21 10:11:04 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2009-06-21 10:11:04 +0000 |
commit | 548a605263f7764602d6ee7fc9ca3856bf00918b (patch) | |
tree | 6eabc072c7905e2561c83ddfb8cc0efd51147c75 /src/order_cmd.cpp | |
parent | 41c8baa7dcf38e85b1ebbee9de77d5b5a31b6622 (diff) | |
download | openttd-548a605263f7764602d6ee7fc9ca3856bf00918b.tar.xz |
(svn r16613) -Fix [NewGRF]: some of the var action 2 80+ variables contained wrong results due to OpenTTD codechanges
Diffstat (limited to 'src/order_cmd.cpp')
-rw-r--r-- | src/order_cmd.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index 48e2f6fd5..2ec2110c6 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -129,6 +129,28 @@ uint32 Order::Pack() const return this->dest << 16 | this->flags << 8 | this->type; } +uint16 Order::MapOldOrder() const +{ + uint16 order = this->GetType(); + switch (this->type) { + case OT_GOTO_STATION: + if (this->GetUnloadType() & OUFB_UNLOAD) SetBit(order, 5); + if (this->GetLoadType() & OLFB_FULL_LOAD) SetBit(order, 6); + if (this->GetNonStopType() & ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS) SetBit(order, 7); + order |= GB(this->GetDestination(), 0, 8) << 8; + break; + case OT_GOTO_DEPOT: + if (!(this->GetDepotOrderType() & ODTFB_PART_OF_ORDERS)) SetBit(order, 6); + SetBit(order, 7); + order |= GB(this->GetDestination(), 0, 8) << 8; + break; + case OT_LOADING: + if (this->GetLoadType() & OLFB_FULL_LOAD) SetBit(order, 6); + break; + } + return order; +} + Order::Order(uint32 packed) { this->type = (OrderType)GB(packed, 0, 8); |