File diff r13023:9f6499c8d4fb → r13024:48c81d0b078a
src/order_cmd.cpp
Show inline comments
 
@@ -176,23 +176,23 @@ Order::Order(uint32 packed)
 
 *
 
 * Updates the widgets of a vehicle which contains the order-data
 
 *
 
 */
 
void InvalidateVehicleOrder(const Vehicle *v, int data)
 
{
 
	InvalidateWindow(WC_VEHICLE_VIEW, v->index);
 
	SetWindowDirty(WC_VEHICLE_VIEW, v->index);
 

	
 
	if (data != 0) {
 
		/* Calls SetDirty() too */
 
		InvalidateWindowData(WC_VEHICLE_ORDERS,    v->index, data);
 
		InvalidateWindowData(WC_VEHICLE_TIMETABLE, v->index, data);
 
		return;
 
	}
 

	
 
	InvalidateWindow(WC_VEHICLE_ORDERS,    v->index);
 
	InvalidateWindow(WC_VEHICLE_TIMETABLE, v->index);
 
	SetWindowDirty(WC_VEHICLE_ORDERS,    v->index);
 
	SetWindowDirty(WC_VEHICLE_TIMETABLE, v->index);
 
}
 

	
 
/**
 
 *
 
 * Assign data to an order (from an other order)
 
 *   This function makes sure that the index is maintained correctly
 
@@ -792,14 +792,14 @@ CommandCost CmdSkipToOrder(TileIndex til
 
		if (v->current_order.IsType(OT_LOADING)) v->LeaveStation();
 

	
 
		InvalidateVehicleOrder(v, -2);
 
	}
 

	
 
	/* We have an aircraft/ship, they have a mini-schedule, so update them all */
 
	if (v->type == VEH_AIRCRAFT) InvalidateWindowClasses(WC_AIRCRAFT_LIST);
 
	if (v->type == VEH_SHIP) InvalidateWindowClasses(WC_SHIPS_LIST);
 
	if (v->type == VEH_AIRCRAFT) SetWindowClassesDirty(WC_AIRCRAFT_LIST);
 
	if (v->type == VEH_SHIP) SetWindowClassesDirty(WC_SHIPS_LIST);
 

	
 
	return CommandCost();
 
}
 

	
 
/**
 
 * Move an order inside the orderlist
 
@@ -1512,13 +1512,13 @@ void RemoveOrderFromAllVehicles(OrderTyp
 
		Order *order;
 

	
 
		order = &v->current_order;
 
		if ((v->type == VEH_AIRCRAFT && order->IsType(OT_GOTO_DEPOT) ? OT_GOTO_STATION : order->GetType()) == type &&
 
				v->current_order.GetDestination() == destination) {
 
			order->MakeDummy();
 
			InvalidateWindow(WC_VEHICLE_VIEW, v->index);
 
			SetWindowDirty(WC_VEHICLE_VIEW, v->index);
 
		}
 

	
 
		/* Clear the order from the order-list */
 
		int id = -1;
 
		FOR_VEHICLE_ORDERS(v, order) {
 
			id++;
 
@@ -1803,13 +1803,13 @@ bool ProcessOrders(Vehicle *v)
 
		case VEH_ROAD:
 
		case VEH_TRAIN:
 
			break;
 

	
 
		case VEH_AIRCRAFT:
 
		case VEH_SHIP:
 
			InvalidateWindowClasses(GetWindowClassForVehicleType(v->type));
 
			SetWindowClassesDirty(GetWindowClassForVehicleType(v->type));
 
			break;
 
	}
 

	
 
	return UpdateOrderDest(v, order) && may_reverse;
 
}