# HG changeset patch # User rubidium # Date 1208156923 0 # Node ID f256fabe64418931c4864d67ab802261f3fdf6b7 # Parent 34ca25f0c6bd01e8c0982f2bd72b07804eb76369 (svn r12698) -Codechange: skip orders to stations that do not have a train part anymore, just like is done for road vehicles and ships. diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp --- a/src/ship_cmd.cpp +++ b/src/ship_cmd.cpp @@ -243,7 +243,7 @@ { if (station == this->last_station_visited) this->last_station_visited = INVALID_STATION; - Station *st = GetStation(station); + const Station *st = GetStation(station); if (st->dock_tile != 0) { return TILE_ADD(st->dock_tile, ToTileIndexDiff(GetDockOffset(st->dock_tile))); } else { diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -2563,7 +2563,14 @@ { 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()