* Cancel the current loading order of the vehicle as the order was deleted. * @param v the vehicle */
| 954 | * @param v the vehicle |
| 955 | */ |
| 956 | static 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. |
no test coverage detected