diff --git a/OpenRA.Mods.Common/Traits/Player/PlayerStatistics.cs b/OpenRA.Mods.Common/Traits/Player/PlayerStatistics.cs index b3482cf464..5e40985434 100644 --- a/OpenRA.Mods.Common/Traits/Player/PlayerStatistics.cs +++ b/OpenRA.Mods.Common/Traits/Player/PlayerStatistics.cs @@ -212,6 +212,24 @@ namespace OpenRA.Mods.Common.Traits if (self.Owner.WinState != WinState.Undefined) return; + if (includedInArmyValue) + { + playerStats.ArmyValue -= cost; + includedInArmyValue = false; + playerStats.Units[actorName].Count--; + } + + if (includedInAssetsValue) + { + playerStats.AssetsValue -= cost; + includedInAssetsValue = false; + } + + playerStats.DeathsCost += cost; + + if (e.Attacker == self) + return; + var attackerStats = e.Attacker.Owner.PlayerActor.Trait(); if (self.Info.HasTraitInfo()) { @@ -225,19 +243,6 @@ namespace OpenRA.Mods.Common.Traits } attackerStats.KillsCost += cost; - playerStats.DeathsCost += cost; - if (includedInArmyValue) - { - playerStats.ArmyValue -= cost; - includedInArmyValue = false; - playerStats.Units[actorName].Count--; - } - - if (includedInAssetsValue) - { - playerStats.AssetsValue -= cost; - includedInAssetsValue = false; - } } void INotifyCreated.Created(Actor self)