Scheduled Dispatch: Fix bug resulting in a hang

If a vechile order is decloned.
This commit is contained in:
innocenat
2017-07-03 16:49:58 +07:00
parent 19408cc2c7
commit 708514dc35

View File

@@ -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);