diff options
author | frosch <frosch@openttd.org> | 2009-01-08 18:08:14 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2009-01-08 18:08:14 +0000 |
commit | 26e9c4c489cd4deefb0002e2d18f142ca8221810 (patch) | |
tree | c480f4195b8351ba7e0a7c0abe64411626a8603f /src/npf.cpp | |
parent | c8c61e36bdfe2de8e3785b6c3912a733f099df3e (diff) | |
download | openttd-26e9c4c489cd4deefb0002e2d18f142ca8221810.tar.xz |
(svn r14921) -Fix [FS#2507]: Do not try to calculate a center of a train-station, when there is none.
Diffstat (limited to 'src/npf.cpp')
-rw-r--r-- | src/npf.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/npf.cpp b/src/npf.cpp index f29dc1fa3..b4b836b9d 100644 --- a/src/npf.cpp +++ b/src/npf.cpp @@ -101,6 +101,9 @@ static TileIndex CalcClosestStationTile(StationID station, TileIndex tile) { const Station* st = GetStation(station); + /* If the rail station is (temporarily) not present, use the station sign to drive near the station */ + if (!IsValidTile(st->train_tile)) return st->xy; + uint minx = TileX(st->train_tile); // topmost corner of station uint miny = TileY(st->train_tile); uint maxx = minx + st->trainst_w - 1; // lowermost corner of station |