MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / CancelLoadingDueToDeletedOrder

Function CancelLoadingDueToDeletedOrder

src/order_cmd.cpp:956–965  ·  view source on GitHub ↗

* Cancel the current loading order of the vehicle as the order was deleted. * @param v the vehicle */

Source from the content-addressed store, hash-verified

954 * @param v the vehicle
955 */
956static void CancelLoadingDueToDeletedOrder(Vehicle *v)
957{
958 assert(v->current_order.IsType(OT_LOADING));
959 /* NON-stop flag is misused to see if a train is in a station that is
960 * on its order list or not */
961 v->current_order.SetNonStopType({});
962 /* When full loading, "cancel" that order so the vehicle doesn't
963 * stay indefinitely at this station anymore. */
964 if (v->current_order.IsFullLoadOrder()) v->current_order.SetLoadType(OrderLoadType::LoadIfPossible);
965}
966
967/**
968 * Delete an order but skip the parameter validation.

Callers 2

DeleteOrderFunction · 0.85
DeleteVehicleOrdersFunction · 0.85

Calls 4

IsTypeMethod · 0.80
SetNonStopTypeMethod · 0.80
IsFullLoadOrderMethod · 0.80
SetLoadTypeMethod · 0.80

Tested by

no test coverage detected