Create INotifyDamageStateChanged for nearly everything else that used INotifyDamage.
This commit is contained in:
@@ -90,7 +90,6 @@ namespace OpenRA.Traits
|
||||
Damage = damage,
|
||||
DamageState = this.DamageState,
|
||||
PreviousDamageState = oldState,
|
||||
DamageStateChanged = this.DamageState != oldState,
|
||||
Warhead = warhead,
|
||||
};
|
||||
|
||||
@@ -98,6 +97,11 @@ namespace OpenRA.Traits
|
||||
.Concat(self.Owner.PlayerActor.TraitsImplementing<INotifyDamage>()))
|
||||
nd.Damaged(self, ai);
|
||||
|
||||
|
||||
if (DamageState != oldState)
|
||||
foreach (var nd in self.TraitsImplementing<INotifyDamageStateChanged>())
|
||||
nd.DamageStateChanged(self, ai);
|
||||
|
||||
if (attacker != null && attacker.IsInWorld && !attacker.IsDead())
|
||||
foreach (var nd in attacker.TraitsImplementing<INotifyAppliedDamage>()
|
||||
.Concat(attacker.Owner.PlayerActor.TraitsImplementing<INotifyAppliedDamage>()))
|
||||
|
||||
Reference in New Issue
Block a user