(svn r13660) [NoAI] -Fix: Is(Tunnel|Bridge)Tile could cause asserts (spotted by Yexo and ST_) noai
authortruebrain
Mon, 30 Jun 2008 13:51:28 +0000
branchnoai
changeset 11102 aacdde10b4ad
parent 11101 94e33f3174a6
child 11108 fc7b43610af2
(svn r13660) [NoAI] -Fix: Is(Tunnel|Bridge)Tile could cause asserts (spotted by Yexo and ST_)
src/ai/api/ai_bridge.cpp
src/ai/api/ai_tunnel.cpp
--- a/src/ai/api/ai_bridge.cpp	Mon Jun 30 13:49:41 2008 +0000
+++ b/src/ai/api/ai_bridge.cpp	Mon Jun 30 13:51:28 2008 +0000
@@ -19,6 +19,7 @@
 
 /* static */ bool AIBridge::IsBridgeTile(TileIndex tile)
 {
+	if (!::IsValidTile(tile)) return false;
 	return ::IsBridgeTile(tile);
 }
 
--- a/src/ai/api/ai_tunnel.cpp	Mon Jun 30 13:49:41 2008 +0000
+++ b/src/ai/api/ai_tunnel.cpp	Mon Jun 30 13:51:28 2008 +0000
@@ -14,6 +14,7 @@
 
 /* static */ bool AITunnel::IsTunnelTile(TileIndex tile)
 {
+	if (!::IsValidTile(tile)) return false;
 	return ::IsTunnelTile(tile);
 }