From fc381496b7453f676086e3d91cab97ca054bed00 Mon Sep 17 00:00:00 2001 From: frosch Date: Thu, 8 Jan 2009 18:08:14 +0000 Subject: (svn r14921) -Fix [FS#2507]: Do not try to calculate a center of a train-station, when there is none. --- src/yapf/yapf_destrail.hpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/yapf') diff --git a/src/yapf/yapf_destrail.hpp b/src/yapf/yapf_destrail.hpp index 503b7f530..2af12e271 100644 --- a/src/yapf/yapf_destrail.hpp +++ b/src/yapf/yapf_destrail.hpp @@ -119,6 +119,9 @@ protected: { 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 x = TileX(st->train_tile) + st->trainst_w / 2; uint y = TileY(st->train_tile) + st->trainst_h / 2; // return the tile of our target coordinates -- cgit v1.2.3-70-g09d2