1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-15 08:22:34 +01:00

(svn r16638) [0.7] -Backport from trunk:

- Fix: Loading of some town data from old savegames was broken (r16631)
- Fix: [NewGRF] Some of the var action 2 80+ variables contained wrong values from NewGRF perspective (r16615, r16613)
- Fix: Antialiased fonts broken; check pixel_mode instead of palette_mode (r16602)
- Fix: Give a more meaningful error message when console commands expect an integer but do not get one (r16600)
This commit is contained in:
rubidium
2009-06-23 20:48:48 +00:00
parent 024aa14f94
commit 0ffca06944
8 changed files with 75 additions and 33 deletions

View File

@@ -125,6 +125,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);