(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.
authorrubidium
Thu, 21 Jun 2007 15:13:09 +0000
changeset 6993 96260dbb34d6
parent 6992 eac917ac2a27
child 6994 8eab245a77c3
(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
--- a/src/town_cmd.cpp	Thu Jun 21 14:58:30 2007 +0000
+++ b/src/town_cmd.cpp	Thu Jun 21 15:13:09 2007 +0000
@@ -668,6 +668,8 @@
 
 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;