diff --git a/OpenRA.Mods.Common/Activities/Attack.cs b/OpenRA.Mods.Common/Activities/Attack.cs index 84ea1e91b3..e8968cd2f0 100644 --- a/OpenRA.Mods.Common/Activities/Attack.cs +++ b/OpenRA.Mods.Common/Activities/Attack.cs @@ -255,7 +255,7 @@ namespace OpenRA.Mods.Common.Activities { if (!attack.IsTraitPaused) foreach (var a in armaments) - a.CheckFire(self, facing, target, false); + a.CheckFire(self, facing, target); } void IActivityNotifyStanceChanged.StanceChanged(Actor self, AutoTarget autoTarget, UnitStance oldStance, UnitStance newStance) diff --git a/OpenRA.Mods.Common/Traits/Air/AttackBomber.cs b/OpenRA.Mods.Common/Traits/Air/AttackBomber.cs index 4f02953b9b..b22236a42b 100644 --- a/OpenRA.Mods.Common/Traits/Air/AttackBomber.cs +++ b/OpenRA.Mods.Common/Traits/Air/AttackBomber.cs @@ -65,7 +65,7 @@ namespace OpenRA.Mods.Common.Traits continue; inAttackRange = true; - a.CheckFire(self, facing, target, false); + a.CheckFire(self, facing, target); } // Actors without armaments may want to trigger an action when it passes the target diff --git a/OpenRA.Mods.Common/Traits/Armament.cs b/OpenRA.Mods.Common/Traits/Armament.cs index 283b6b677f..dbf6929d48 100644 --- a/OpenRA.Mods.Common/Traits/Armament.cs +++ b/OpenRA.Mods.Common/Traits/Armament.cs @@ -268,7 +268,7 @@ namespace OpenRA.Mods.Common.Traits // Note: facing is only used by the legacy positioning code // The world coordinate model uses Actor.Orientation - public virtual bool CheckFire(Actor self, IFacing facing, in Target target, bool notifyAttacking) + public virtual bool CheckFire(Actor self, IFacing facing, in Target target) { if (!CanFire(self, target)) return false; @@ -286,10 +286,6 @@ namespace OpenRA.Mods.Common.Traits FireBarrel(self, facing, target, barrel); UpdateBurst(self, target); - - if (notifyAttacking) - foreach (var (notifyActor, notify) in notifyAttacks) - notify.Attacking(notifyActor, target, this, barrel); } while (FireDelay == 0 && CanFire(self, target)); @@ -357,11 +353,11 @@ namespace OpenRA.Mods.Common.Traits if (burst == args.Weapon.Burst && args.Weapon.StartBurstReport != null && args.Weapon.StartBurstReport.Length > 0) Game.Sound.Play(SoundType.World, args.Weapon.StartBurstReport, self.World, self.CenterPosition); - foreach (var (notifyActor, notify) in notifyAttacks) - notify.Attacking(notifyActor, delayedTarget, this, barrel); - Recoil = Info.Recoil; } + + foreach (var (notifyActor, notify) in notifyAttacks) + notify.Attacking(notifyActor, delayedTarget, this, barrel); }); } diff --git a/OpenRA.Mods.Common/Traits/Attack/AttackBase.cs b/OpenRA.Mods.Common/Traits/Attack/AttackBase.cs index aa75a05511..d38c325525 100644 --- a/OpenRA.Mods.Common/Traits/Attack/AttackBase.cs +++ b/OpenRA.Mods.Common/Traits/Attack/AttackBase.cs @@ -169,7 +169,7 @@ namespace OpenRA.Mods.Common.Traits return; foreach (var a in Armaments) - a.CheckFire(self, facing, target, false); + a.CheckFire(self, facing, target); } IEnumerable IIssueOrder.Orders diff --git a/OpenRA.Mods.Common/Traits/Attack/AttackGarrisoned.cs b/OpenRA.Mods.Common/Traits/Attack/AttackGarrisoned.cs index 3bf38c9ed2..735516cca6 100644 --- a/OpenRA.Mods.Common/Traits/Attack/AttackGarrisoned.cs +++ b/OpenRA.Mods.Common/Traits/Attack/AttackGarrisoned.cs @@ -185,7 +185,7 @@ namespace OpenRA.Mods.Common.Traits paxFacing[a.Actor].Facing = targetYaw; paxPos[a.Actor].SetCenterPosition(a.Actor, pos + PortOffset(self, port)); - if (!a.CheckFire(a.Actor, facing, target, true)) + if (!a.CheckFire(a.Actor, facing, target)) continue; if (a.Info.MuzzleSequence != null) diff --git a/OpenRA.Mods.D2k/Activities/SwallowActor.cs b/OpenRA.Mods.D2k/Activities/SwallowActor.cs index fee76d9aca..eafed0080f 100644 --- a/OpenRA.Mods.D2k/Activities/SwallowActor.cs +++ b/OpenRA.Mods.D2k/Activities/SwallowActor.cs @@ -85,7 +85,7 @@ namespace OpenRA.Mods.D2k.Activities if (affectedPlayers.Contains(self.World.LocalPlayer)) TextNotificationsManager.AddTransientLine(self.World.LocalPlayer, swallow.Info.WormAttackTextNotification); - return armament.CheckFire(self, facing, target, true); + return armament.CheckFire(self, facing, target); } public override bool Tick(Actor self)