Fix auto timetable not being unset when sharing orders.
Copy auto timetable when copying orders. Clear autofill timetable when sharing, or copying automated orders.
This commit is contained in:
@@ -1624,7 +1624,11 @@ CommandCost CmdCloneOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
|
||||
/* Set automation bit if target has it. */
|
||||
if (HasBit(src->vehicle_flags, VF_AUTOMATE_TIMETABLE)) {
|
||||
SetBit(dst->vehicle_flags, VF_AUTOMATE_TIMETABLE);
|
||||
} else {
|
||||
ClrBit(dst->vehicle_flags, VF_AUTOMATE_TIMETABLE);
|
||||
}
|
||||
ClrBit(dst->vehicle_flags, VF_AUTOFILL_TIMETABLE);
|
||||
ClrBit(dst->vehicle_flags, VF_AUTOFILL_PRES_WAIT_TIME);
|
||||
|
||||
dst->ClearSeparation();
|
||||
if (_settings_game.order.timetable_separation) ClrBit(dst->vehicle_flags, VF_TIMETABLE_STARTED);
|
||||
@@ -1693,6 +1697,15 @@ CommandCost CmdCloneOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
|
||||
dst->orders.list = new OrderList(first, dst);
|
||||
}
|
||||
|
||||
/* Set automation bit if target has it. */
|
||||
if (HasBit(src->vehicle_flags, VF_AUTOMATE_TIMETABLE)) {
|
||||
SetBit(dst->vehicle_flags, VF_AUTOMATE_TIMETABLE);
|
||||
ClrBit(dst->vehicle_flags, VF_AUTOFILL_TIMETABLE);
|
||||
ClrBit(dst->vehicle_flags, VF_AUTOFILL_PRES_WAIT_TIME);
|
||||
} else {
|
||||
ClrBit(dst->vehicle_flags, VF_AUTOMATE_TIMETABLE);
|
||||
}
|
||||
|
||||
InvalidateVehicleOrder(dst, VIWD_REMOVE_ALL_ORDERS);
|
||||
|
||||
InvalidateWindowClassesData(GetWindowClassForVehicleType(dst->type), 0);
|
||||
|
||||
Reference in New Issue
Block a user