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
commitb6cbd30c3fb24e4f97a61853f6e1ee86ba0e99c4 (patch)
treec4a2681ebb80880cb654fb5876d2f66b060ce030
parent709ec2956360dc7a4e998b621f4db0417408de24 (diff)
downloadopenttd-b6cbd30c3fb24e4f97a61853f6e1ee86ba0e99c4.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;