From 3b01d312802d03404bcf7d94fb48f0964fce090e Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sun, 21 Apr 2024 19:41:25 +0100 Subject: [PATCH] Fix 8746be8: Reinstate current order test when removing road stop. (#12552) #12144 replaced pool iteration with FindVehiclesWithOrder, however the test for current_order being OT_GOTO_STATION was erroneously removed. --- src/station_cmd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index dd32c4f006..615e680723 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -2192,7 +2192,7 @@ static CommandCost RemoveRoadStop(TileIndex tile, DoCommandFlag flags, int repla [](const Vehicle *v) { return v->type == VEH_ROAD; }, [station_id](const Order *order) { return order->IsType(OT_GOTO_STATION) && order->GetDestination() == station_id; }, [station_id, tile](Vehicle *v) { - if (v->dest_tile == tile) { + if (v->current_order.IsType(OT_GOTO_STATION) && v->dest_tile == tile) { v->SetDestTile(v->GetOrderStationLocation(station_id)); } }