Changeset - r9726:ec64c83165c1
[Not reviewed]
master
0 1 0
frosch - 16 years ago 2008-07-27 18:36:11
frosch@openttd.org
(svn r13851) -Fix (r9393): GetTownByTile() is only valid for houses and roads.
1 file changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/newgrf_station.cpp
Show inline comments
 
@@ -15,13 +15,13 @@
 
#include "newgrf_callbacks.h"
 
#include "newgrf_commons.h"
 
#include "newgrf_station.h"
 
#include "newgrf_spritegroup.h"
 
#include "newgrf_sound.h"
 
#include "cargotype.h"
 
#include "town_map.h"
 
#include "town.h"
 
#include "newgrf_town.h"
 
#include "gfx_func.h"
 
#include "date_func.h"
 
#include "player_func.h"
 
#include "animated_tile_func.h"
 
#include "functions.h"
 
@@ -358,18 +358,18 @@ static uint32 StationGetVariable(const R
 
{
 
	const Station *st = object->u.station.st;
 
	TileIndex tile = object->u.station.tile;
 

	
 
	if (object->scope == VSG_SCOPE_PARENT) {
 
		/* Pass the request on to the town of the station */
 
		Town *t;
 
		const Town *t;
 

	
 
		if (st != NULL) {
 
			t = st->town;
 
		} else if (tile != INVALID_TILE) {
 
			t = GetTownByTile(tile);
 
			t = ClosestTownFromTile(tile, UINT_MAX);
 
		} else {
 
			*available = false;
 
			return UINT_MAX;
 
		}
 

	
 
		return TownGetVariable(variable, parameter, available, t);
0 comments (0 inline, 0 general)