* Return all reserved cargo packets to the station and reset all packets * staged for transfer. * @param st the station where the reserved packets should go. */
| 2309 | * @param st the station where the reserved packets should go. |
| 2310 | */ |
| 2311 | void Vehicle::CancelReservation(StationID next, Station *st) |
| 2312 | { |
| 2313 | for (Vehicle *v = this; v != nullptr; v = v->next) { |
| 2314 | VehicleCargoList &cargo = v->cargo; |
| 2315 | if (cargo.ActionCount(VehicleCargoList::MTA_LOAD) > 0) { |
| 2316 | Debug(misc, 1, "cancelling cargo reservation"); |
| 2317 | cargo.Return(UINT_MAX, &st->goods[v->cargo_type].GetOrCreateData().cargo, next, v->tile); |
| 2318 | } |
| 2319 | cargo.KeepAll(); |
| 2320 | } |
| 2321 | } |
| 2322 | |
| 2323 | /** |
| 2324 | * Perform all actions when leaving a station. |
no test coverage detected