diff src/town_cmd.cpp @ 6993:1e527dc3c219 draft

(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.
author rubidium <rubidium@openttd.org>
date Thu, 21 Jun 2007 15:13:09 +0000 (2007-06-21)
parents 6d300d04ac5e
children fa5196b1b53d
line wrap: on
line diff
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -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;