Fix loading of depot unbunch bit from vanilla saves
This commit is contained in:
@@ -2160,9 +2160,6 @@ bool AfterLoadGame()
|
|||||||
order->SetWaitTimetabled(HasBit(order->GetRawFlags(), 3));
|
order->SetWaitTimetabled(HasBit(order->GetRawFlags(), 3));
|
||||||
}
|
}
|
||||||
OrderDepotActionFlags flags = (OrderDepotActionFlags)(order->GetDepotActionType() >> 1);
|
OrderDepotActionFlags flags = (OrderDepotActionFlags)(order->GetDepotActionType() >> 1);
|
||||||
if (((flags & (1 << 2)) != 0) && !SlXvIsFeatureMissing(XSLFI_DEPOT_UNBUNCHING)) {
|
|
||||||
flags ^= (ODATFB_SELL | ODATFB_UNBUNCH); // Unbunch moved from bit 2 to bit 3
|
|
||||||
}
|
|
||||||
order->SetDepotActionType(flags);
|
order->SetDepotActionType(flags);
|
||||||
}
|
}
|
||||||
} else if (SlXvIsFeaturePresent(XSLFI_TT_WAIT_IN_DEPOT, 1, 1)) {
|
} else if (SlXvIsFeaturePresent(XSLFI_TT_WAIT_IN_DEPOT, 1, 1)) {
|
||||||
@@ -2171,6 +2168,17 @@ bool AfterLoadGame()
|
|||||||
if (order->IsType(OT_GOTO_DEPOT)) order->SetWaitTimetabled(HasBit(order->GetRawFlags(), 3));
|
if (order->IsType(OT_GOTO_DEPOT)) order->SetWaitTimetabled(HasBit(order->GetRawFlags(), 3));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!IsSavegameVersionBefore(SLV_DEPOT_UNBUNCHING)) {
|
||||||
|
/* Move unbunch depot action from bit 2 to bit 3 */
|
||||||
|
for (Order *order : Order::Iterate()) {
|
||||||
|
if (!order->IsType(OT_GOTO_DEPOT)) continue;
|
||||||
|
OrderDepotActionFlags flags = order->GetDepotActionType();
|
||||||
|
if ((flags & ODATFB_SELL) != 0) {
|
||||||
|
flags ^= (ODATFB_SELL | ODATFB_UNBUNCH); // Move unbunch from bit 2 to bit 3 (sell to unbunch)
|
||||||
|
order->SetDepotActionType(flags);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (SlXvIsFeaturePresent(XSLFI_JOKERPP, 1, SL_JOKER_1_23)) {
|
if (SlXvIsFeaturePresent(XSLFI_JOKERPP, 1, SL_JOKER_1_23)) {
|
||||||
for (Order *order : Order::Iterate()) {
|
for (Order *order : Order::Iterate()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user