(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 7489 0f25d9e299d0
parent 7488 eb26c679b484
child 7490 3550f7e59b2e
(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;