0x0047062B
| 495 | |
| 496 | // 0x0047062B |
| 497 | void removeOrdersForStation(const StationId stationId) |
| 498 | { |
| 499 | for (auto i = 0U; i < orderTableLength();) |
| 500 | { |
| 501 | auto& order = orders()[i]; |
| 502 | auto* stationOrder = order.as<OrderStation>(); |
| 503 | if (stationOrder != nullptr) |
| 504 | { |
| 505 | if (stationOrder->getStation() == stationId) |
| 506 | { |
| 507 | // Find the vehicle that has the order |
| 508 | for (auto* head : VehicleManager::VehicleList()) |
| 509 | { |
| 510 | if (head->orderTableOffset <= i |
| 511 | && i < head->orderTableOffset + head->sizeOfOrderTable) |
| 512 | { |
| 513 | deleteOrder(head, i - head->orderTableOffset); |
| 514 | break; |
| 515 | } |
| 516 | } |
| 517 | } |
| 518 | } |
| 519 | i += kOrderSizes[enumValue(order.getType())]; |
| 520 | } |
| 521 | } |
| 522 | } |
no test coverage detected