Allow opportunity fire for aircraft.

This commit is contained in:
tovl
2019-03-31 22:09:43 +02:00
committed by reaperrr
parent f16ff9eaa0
commit 9abf715fd7
19 changed files with 114 additions and 92 deletions

View File

@@ -191,10 +191,9 @@ namespace OpenRA.Mods.Common.Activities
return AttackStatus.NeedsToMove;
}
var targetedPosition = attack.GetTargetPosition(pos, target);
var desiredFacing = (targetedPosition - pos).Yaw.Facing;
if (!Util.FacingWithinTolerance(facing.Facing, desiredFacing, ((AttackFrontalInfo)attack.Info).FacingTolerance))
if (!attack.TargetInFiringArc(self, target, attack.Info.FacingTolerance))
{
var desiredFacing = (attack.GetTargetPosition(pos, target) - pos).Yaw.Facing;
attackStatus |= AttackStatus.NeedsToTurn;
QueueChild(self, new Turn(self, desiredFacing), true);
return AttackStatus.NeedsToTurn;