summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-06-21 15:13:09 +0000
committerrubidium <rubidium@openttd.org>2007-06-21 15:13:09 +0000
commit3307cb32f43c4c9b6bd343b2db519d571ebc2d6e (patch)
treec4a2681ebb80880cb654fb5876d2f66b060ce030
parentdffad5260b0736e3c66d133de88624e2db195bd7 (diff)
downloadopenttd-3307cb32f43c4c9b6bd343b2db519d571ebc2d6e.tar.xz
(svn r10249) -Fix [FS#906]: town tried to gather information about the neighbourhood of a tile when it couldn't even *ever* build on that tile.
-rw-r--r--src/town_cmd.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index c7cd3a662..1011af7c7 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -668,6 +668,8 @@ static bool NeighborIsRoadTile(TileIndex tile, int dir, RoadBlockTitleDistance d
static bool IsRoadAllowedHere(TileIndex tile, int dir)
{
+ if (TileX(tile) < 1 || TileY(tile) < 1 || MapMaxX() >= TileX(tile) || MapMaxY() >= TileY(tile)) return false;
+
Slope k;
Slope slope;