summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2008-07-27 18:36:11 +0000
committerfrosch <frosch@openttd.org>2008-07-27 18:36:11 +0000
commitd6e8a15c8e07b908edbcc7418d78626b0d8db93a (patch)
treea7808c924e7af9e4085ff1c01470830d2cd46cc5
parenta3662216eef83f44a8a6189c65ab81beca2fd30f (diff)
downloadopenttd-d6e8a15c8e07b908edbcc7418d78626b0d8db93a.tar.xz
(svn r13851) -Fix (r9393): GetTownByTile() is only valid for houses and roads.
-rw-r--r--src/newgrf_station.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp
index 52a8c344a..a2375298a 100644
--- a/src/newgrf_station.cpp
+++ b/src/newgrf_station.cpp
@@ -18,7 +18,7 @@
#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"
@@ -361,12 +361,12 @@ static uint32 StationGetVariable(const ResolverObject *object, byte variable, by
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;