Move some checks in *AttackNotifier to improve performance
This commit is contained in:
@@ -47,10 +47,6 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
public void Damaged(Actor self, AttackInfo e)
|
||||
{
|
||||
// only track last hit against our base
|
||||
if (!self.Info.HasTraitInfo<BuildingInfo>())
|
||||
return;
|
||||
|
||||
if (e.Attacker == null)
|
||||
return;
|
||||
|
||||
@@ -60,6 +56,10 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (e.Attacker == self.World.WorldActor)
|
||||
return;
|
||||
|
||||
// Only track last hit against our base
|
||||
if (!self.Info.HasTraitInfo<BuildingInfo>())
|
||||
return;
|
||||
|
||||
if (e.Attacker.Owner.IsAlliedWith(self.Owner) && e.Damage <= 0)
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user