From c8afa4a2a827b0a90c5487949069babcdb41587b Mon Sep 17 00:00:00 2001 From: reaperrr Date: Sat, 5 Sep 2020 01:24:25 +0200 Subject: [PATCH] Remove defenderStats look-up from UpdatePlayerStatistics playerStats is updated on owner change, so it should always be identical to the removed defenderStats. --- OpenRA.Mods.Common/Traits/Player/PlayerStatistics.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/Player/PlayerStatistics.cs b/OpenRA.Mods.Common/Traits/Player/PlayerStatistics.cs index f2f78faa2b..ab7d472687 100644 --- a/OpenRA.Mods.Common/Traits/Player/PlayerStatistics.cs +++ b/OpenRA.Mods.Common/Traits/Player/PlayerStatistics.cs @@ -235,23 +235,22 @@ namespace OpenRA.Mods.Common.Traits return; var attackerStats = e.Attacker.Owner.PlayerActor.Trait(); - var defenderStats = self.Owner.PlayerActor.Trait(); if (self.Info.HasTraitInfo()) { attackerStats.BuildingsKilled++; - defenderStats.BuildingsDead++; + playerStats.BuildingsDead++; } else if (self.Info.HasTraitInfo()) { attackerStats.UnitsKilled++; - defenderStats.UnitsDead++; + playerStats.UnitsDead++; } attackerStats.KillsCost += cost; - defenderStats.DeathsCost += cost; + playerStats.DeathsCost += cost; if (includedInArmyValue) { - defenderStats.ArmyValue -= cost; + playerStats.ArmyValue -= cost; includedInArmyValue = false; playerStats.Units[actorName].Count--; }