Scheduled Dispatch: Fix bug resulting in a hang
If a vechile order is decloned.
This commit is contained in:
@@ -1132,6 +1132,11 @@ void InsertOrder(Vehicle *v, Order *new_o, VehicleOrderID sel_ord)
|
|||||||
static CommandCost DecloneOrder(Vehicle *dst, DoCommandFlag flags)
|
static CommandCost DecloneOrder(Vehicle *dst, DoCommandFlag flags)
|
||||||
{
|
{
|
||||||
if (flags & DC_EXEC) {
|
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);
|
DeleteVehicleOrders(dst);
|
||||||
InvalidateVehicleOrder(dst, VIWD_REMOVE_ALL_ORDERS);
|
InvalidateVehicleOrder(dst, VIWD_REMOVE_ALL_ORDERS);
|
||||||
InvalidateWindowClassesData(GetWindowClassForVehicleType(dst->type), 0);
|
InvalidateWindowClassesData(GetWindowClassForVehicleType(dst->type), 0);
|
||||||
|
Reference in New Issue
Block a user