From f1f032dbb824e709ee510220e7bcf1ddf2b42554 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Fri, 1 Nov 2013 17:42:48 +1300 Subject: [PATCH] Don't crash if trying to check targets outside the map. --- OpenRA.Game/GameRules/WeaponInfo.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OpenRA.Game/GameRules/WeaponInfo.cs b/OpenRA.Game/GameRules/WeaponInfo.cs index ae67d887e7..37962ee8f4 100644 --- a/OpenRA.Game/GameRules/WeaponInfo.cs +++ b/OpenRA.Game/GameRules/WeaponInfo.cs @@ -172,6 +172,9 @@ namespace OpenRA.GameRules if (target.Type == TargetType.Terrain) { var cell = target.CenterPosition.ToCPos(); + if (!world.Map.IsInMap(cell)) + return false; + if (ValidTargets.Contains("Ground") && world.GetTerrainType(cell) != "Water") return true;