(gecko) Send damage notifications to the owner's player actor too.

This commit is contained in:
Chris Forbes
2010-11-02 13:32:37 +13:00
parent 9489196911
commit 7762241653

View File

@@ -80,15 +80,15 @@ namespace OpenRA.Traits
var oldState = this.DamageState;
/* apply the damage modifiers, if we have any. */
var modifier = (float)self.TraitsImplementing<IDamageModifier>()
/* apply the damage modifiers, if we have any. */
var modifier = (float)self.TraitsImplementing<IDamageModifier>().Concat(self.Owner.PlayerActor.TraitsImplementing<IDamageModifier>())
.Select(t => t.GetDamageModifier(warhead)).Product();
damage = (int)(damage * modifier);
hp -= damage;
foreach (var nd in self.TraitsImplementing<INotifyDamage>())
hp -= damage;
foreach (var nd in self.TraitsImplementing<INotifyDamage>().Concat(self.Owner.PlayerActor.TraitsImplementing<INotifyDamage>()))
nd.Damaged(self, new AttackInfo
{
Attacker = attacker,