Make aircraft not waste their missiles by firing from outside the map

Fixes #6001.

This obviously affects Yaks as well as Migs, even though Yaks had no
trouble with attacking from outside the map.
This commit is contained in:
Oliver Brakmann
2014-07-20 17:37:50 +02:00
parent ad2327828d
commit e97efc89cb

View File

@@ -29,8 +29,8 @@ namespace OpenRA.Mods.RA.Air
protected override bool CanAttack(Actor self, Target target)
{
// dont fire while landed
return base.CanAttack(self, target) && self.CenterPosition.Z > 0;
// dont fire while landed or when outside the map
return base.CanAttack(self, target) && self.CenterPosition.Z > 0 && self.World.Map.Contains(self.Location);
}
}
}