From 7812e1c314d548b5c25310d85b1908c80c1c208f Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sun, 13 Jun 2010 00:25:14 +1200 Subject: [PATCH] don't fail with offscreen impacts --- OpenRA.Game/Combat.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OpenRA.Game/Combat.cs b/OpenRA.Game/Combat.cs index 76d9474179..8791c2b494 100644 --- a/OpenRA.Game/Combat.cs +++ b/OpenRA.Game/Combat.cs @@ -44,6 +44,10 @@ namespace OpenRA { var world = args.firedBy.World; var targetTile = ((1f / Game.CellSize) * args.dest.ToFloat2()).ToInt2(); + + if (!world.Map.IsInMap(targetTile)) + return; + var isWater = world.GetTerrainType(targetTile) == TerrainType.Water; if (warhead.Explosion != 0)