Changeset - r10627:bf59cd9efaee
[Not reviewed]
master
0 2 0
frosch - 16 years ago 2009-01-08 18:08:14
frosch@openttd.org
(svn r14921) -Fix [FS#2507]: Do not try to calculate a center of a train-station, when there is none.
2 files changed with 6 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/npf.cpp
Show inline comments
 
@@ -101,6 +101,9 @@ static TileIndex CalcClosestStationTile(
 
{
 
	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
src/yapf/yapf_destrail.hpp
Show inline comments
 
@@ -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
0 comments (0 inline, 0 general)