Move some checks in *AttackNotifier to improve performance

This commit is contained in:
abcdefg30
2016-01-10 00:59:33 +01:00
parent 2ae9bc7ebd
commit a56ffb581f
2 changed files with 8 additions and 8 deletions

View File

@@ -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;