# HG changeset patch # User rubidium # Date 2007-06-21 15:13:09 # Node ID d3a283847bedb1e4d7beea3860ea61229ff4330f # Parent 38850e911adbf7f1820573b490f2915f93e52bf1 (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. diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -668,6 +668,8 @@ static bool NeighborIsRoadTile(TileIndex 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;