Scheduled Dispatch: Fix bug resulting in a hang

If a vechile order is decloned.
pull/21/merge
innocenat 7 years ago
parent 19408cc2c7
commit 708514dc35

@ -1132,6 +1132,11 @@ void InsertOrder(Vehicle *v, Order *new_o, VehicleOrderID sel_ord)
static CommandCost DecloneOrder(Vehicle *dst, DoCommandFlag flags)
{
if (flags & DC_EXEC) {
/* Clear cheduled dispatch flag if any */
if (HasBit(dst->vehicle_flags, VF_SCHEDULED_DISPATCH)) {
ClrBit(dst->vehicle_flags, VF_SCHEDULED_DISPATCH);
}
DeleteVehicleOrders(dst);
InvalidateVehicleOrder(dst, VIWD_REMOVE_ALL_ORDERS);
InvalidateWindowClassesData(GetWindowClassForVehicleType(dst->type), 0);

Loading…
Cancel
Save