summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-10-07 18:46:12 +0000
committerrubidium <rubidium@openttd.org>2008-10-07 18:46:12 +0000
commit4b5d506313c0399d179a4547f9f9ddfa94d86e40 (patch)
tree5adfff5f5ed00da8b1bba8367f5bd3f22d29ffd5
parente06cb49fa09206d8591dde90e01a64b6701dcd77 (diff)
downloadopenttd-4b5d506313c0399d179a4547f9f9ddfa94d86e40.tar.xz
(svn r14446) -Fix [FS#2330]: when a road stop gets moved make sure to update the destination of RVs going to that road stop.
-rw-r--r--src/station_cmd.cpp12
1 files changed, 12 insertions, 0 deletions
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);