From 719891c23e284554edaddc642991fe58a4fd5f14 Mon Sep 17 00:00:00 2001 From: rubidium Date: Tue, 7 Oct 2008 18:46:12 +0000 Subject: (svn r14446) -Fix [FS#2330]: when a road stop gets moved make sure to update the destination of RVs going to that road stop. --- src/station_cmd.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index cabadaa2a..15fca6f33 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -1532,6 +1532,18 @@ static CommandCost RemoveRoadStop(Station *st, uint32 flags, TileIndex tile) InvalidateWindowWidget(WC_STATION_VIEW, st->index, SVW_ROADVEHS); delete cur_stop; + + /* Make sure no vehicle is going to the old roadstop */ + Vehicle *v; + FOR_ALL_VEHICLES(v) { + if (v->type == VEH_ROAD && + v->First() == v && + v->current_order.IsType(OT_GOTO_STATION) && + v->dest_tile == tile) { + v->dest_tile = v->GetOrderStationLocation(st->index); + } + } + DoClearSquare(tile); st->rect.AfterRemoveTile(st, tile); -- cgit v1.2.3-70-g09d2