Don't count actors owned by noncombatant players to kills statistic

This commit is contained in:
abc013
2021-10-26 18:42:45 +02:00
committed by Matthias Mailänder
parent c0da9f1eab
commit 311b6fcd83

View File

@@ -233,16 +233,21 @@ namespace OpenRA.Mods.Common.Traits
var attackerStats = e.Attacker.Owner.PlayerActor.Trait<PlayerStatistics>();
if (self.Info.HasTraitInfo<BuildingInfo>())
{
attackerStats.BuildingsKilled++;
if (!self.Owner.NonCombatant)
attackerStats.BuildingsKilled++;
playerStats.BuildingsDead++;
}
else if (self.Info.HasTraitInfo<IPositionableInfo>())
{
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)