From 311b6fcd831df8f34e686da0a6042177cdf4629d Mon Sep 17 00:00:00 2001 From: abc013 Date: Tue, 26 Oct 2021 18:42:45 +0200 Subject: [PATCH] Don't count actors owned by noncombatant players to kills statistic --- OpenRA.Mods.Common/Traits/Player/PlayerStatistics.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/Player/PlayerStatistics.cs b/OpenRA.Mods.Common/Traits/Player/PlayerStatistics.cs index 5e40985434..88c5bec472 100644 --- a/OpenRA.Mods.Common/Traits/Player/PlayerStatistics.cs +++ b/OpenRA.Mods.Common/Traits/Player/PlayerStatistics.cs @@ -233,16 +233,21 @@ namespace OpenRA.Mods.Common.Traits var attackerStats = e.Attacker.Owner.PlayerActor.Trait(); if (self.Info.HasTraitInfo()) { - attackerStats.BuildingsKilled++; + if (!self.Owner.NonCombatant) + attackerStats.BuildingsKilled++; + playerStats.BuildingsDead++; } else if (self.Info.HasTraitInfo()) { - attackerStats.UnitsKilled++; + if (!self.Owner.NonCombatant) + attackerStats.UnitsKilled++; + playerStats.UnitsDead++; } - attackerStats.KillsCost += cost; + if (!self.Owner.NonCombatant) + attackerStats.KillsCost += cost; } void INotifyCreated.Created(Actor self)