From 14b307a621432dae325c2783422387843871e86b Mon Sep 17 00:00:00 2001 From: rubidium Date: Mon, 14 Apr 2008 07:08:43 +0000 Subject: (svn r12698) -Codechange: skip orders to stations that do not have a train part anymore, just like is done for road vehicles and ships. --- src/train_cmd.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/train_cmd.cpp') diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 39236c261..076a9e225 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -2563,7 +2563,14 @@ TileIndex Train::GetOrderStationLocation(StationID station) { if (station == this->last_station_visited) this->last_station_visited = INVALID_STATION; - return GetStation(station)->xy; + const Station *st = GetStation(station); + if (!(st->facilities & FACIL_TRAIN)) { + /* The destination station has no trainstation tiles. */ + this->cur_order_index++; + return 0; + } + + return st->xy; } void Train::MarkDirty() -- cgit v1.2.3-54-g00ecf