From b6cbd30c3fb24e4f97a61853f6e1ee86ba0e99c4 Mon Sep 17 00:00:00 2001 From: rubidium Date: Thu, 21 Jun 2007 15:13:09 +0000 Subject: (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. --- src/town_cmd.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') 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; -- cgit v1.2.3-70-g09d2