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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user