Don't crash if trying to check targets outside the map.
This commit is contained in:
@@ -172,6 +172,9 @@ namespace OpenRA.GameRules
|
|||||||
if (target.Type == TargetType.Terrain)
|
if (target.Type == TargetType.Terrain)
|
||||||
{
|
{
|
||||||
var cell = target.CenterPosition.ToCPos();
|
var cell = target.CenterPosition.ToCPos();
|
||||||
|
if (!world.Map.IsInMap(cell))
|
||||||
|
return false;
|
||||||
|
|
||||||
if (ValidTargets.Contains("Ground") && world.GetTerrainType(cell) != "Water")
|
if (ValidTargets.Contains("Ground") && world.GetTerrainType(cell) != "Water")
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user