diff --git a/OpenRA.Mods.RA/Activities/Teleport.cs b/OpenRA.Mods.RA/Activities/Teleport.cs index 39ad10bd0d..99ce99e4ee 100755 --- a/OpenRA.Mods.RA/Activities/Teleport.cs +++ b/OpenRA.Mods.RA/Activities/Teleport.cs @@ -42,10 +42,12 @@ namespace OpenRA.Mods.RA.Activities var cargo = self.Trait(); while (!cargo.IsEmpty(self)) { - if (chronosphere != null) - chronosphere.Owner.Kills++; + if (chronosphere != null && chronosphere.HasTrait()) + chronosphere.Owner.PlayerActor.Trait().UnitsKilled++; + var a = cargo.Unload(self); - a.Owner.Deaths++; + if (a.HasTrait()) + a.Owner.PlayerActor.Trait().UnitsDead++; } } diff --git a/OpenRA.Mods.RA/Missions/Allies02Script.cs b/OpenRA.Mods.RA/Missions/Allies02Script.cs index f6a63cd091..fcd455985f 100644 --- a/OpenRA.Mods.RA/Missions/Allies02Script.cs +++ b/OpenRA.Mods.RA/Missions/Allies02Script.cs @@ -252,7 +252,7 @@ namespace OpenRA.Mods.RA.Missions void UpdateDeaths() { - var unitDeaths = allies1.Deaths + allies2.Deaths; + var unitDeaths = allies1.PlayerActor.Trait().UnitsDead + allies2.PlayerActor.Trait().UnitsDead; fewDeaths.Text = FewDeathsTemplate.F(unitDeaths, DeathsThreshold); OnObjectivesUpdated(false); if (unitDeaths >= DeathsThreshold && fewDeaths.Status == ObjectiveStatus.InProgress) diff --git a/OpenRA.Mods.RA/Widgets/Logic/ObserverStatsLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/ObserverStatsLogic.cs index c0a268aee4..4b03b0818a 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/ObserverStatsLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/ObserverStatsLogic.cs @@ -257,11 +257,10 @@ namespace OpenRA.Mods.RA.Widgets.Logic power.GetText = () => powerRes.PowerDrained + "/" + powerRes.PowerProvided; power.GetColor = () => GetPowerColor(powerRes.PowerState); - template.Get("KILLS").GetText = () => player.Kills.ToString(); - template.Get("DEATHS").GetText = () => player.Deaths.ToString(); - var stats = player.PlayerActor.TraitOrDefault(); if (stats == null) return template; + template.Get("KILLS").GetText = () => (stats.UnitsKilled + stats.BuildingsKilled).ToString(); + template.Get("DEATHS").GetText = () => (stats.UnitsDead + stats.UnitsDead).ToString(); template.Get("ACTIONS_MIN").GetText = () => AverageOrdersPerMinute(stats.OrderCount); return template;