Make notifyAttacks more consistent
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -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<IOrderTargeter> IIssueOrder.Orders
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user