diff --git a/OpenRA.Mods.RA/Activities/Sell.cs b/OpenRA.Mods.RA/Activities/Sell.cs index 95f5a84ed6..ddc2f78652 100755 --- a/OpenRA.Mods.RA/Activities/Sell.cs +++ b/OpenRA.Mods.RA/Activities/Sell.cs @@ -31,7 +31,7 @@ namespace OpenRA.Mods.RA.Activities foreach (var ns in self.TraitsImplementing()) ns.Sold(self); - if (refund > 0 && self.World.LocalPlayer != null && self.Owner.Stances[self.World.LocalPlayer] == Stance.Ally) + if (refund > 0 && self.Owner.IsAlliedWith(self.World.RenderPlayer)) self.World.AddFrameEndTask(w => w.Add(new CashTick(refund, 30, 2, self.CenterLocation, self.Owner.Color.RGB))); self.Destroy(); @@ -39,6 +39,6 @@ namespace OpenRA.Mods.RA.Activities } // Cannot be cancelled - public override void Cancel( Actor self ) { } + public override void Cancel(Actor self) { } } } diff --git a/OpenRA.Mods.RA/Effects/CashTick.cs b/OpenRA.Mods.RA/Effects/CashTick.cs index 976885945b..77d220e453 100644 --- a/OpenRA.Mods.RA/Effects/CashTick.cs +++ b/OpenRA.Mods.RA/Effects/CashTick.cs @@ -29,7 +29,7 @@ namespace OpenRA.Mods.RA.Effects static string FormatCashAmount(int x) { return "{0}${1}".F(x < 0 ? "-" : "+", x); } public CashTick(int value, int lifetime, int velocity, PPos pos, Color color) - : this( FormatCashAmount(value), lifetime, velocity, pos, color ) { } + : this(FormatCashAmount(value), lifetime, velocity, pos, color) { } public CashTick(string value, int lifetime, int velocity, PPos pos, Color color) { diff --git a/OpenRA.Mods.RA/GivesBounty.cs b/OpenRA.Mods.RA/GivesBounty.cs index 33cb51e101..0a3064308d 100644 --- a/OpenRA.Mods.RA/GivesBounty.cs +++ b/OpenRA.Mods.RA/GivesBounty.cs @@ -53,7 +53,7 @@ namespace OpenRA.Mods.RA // 2 hundreds because of GetMultiplier and info.Percentage. var bounty = cost * GetMultiplier(self) * info.Percentage / 10000; - if (bounty > 0 && e.Attacker.World.LocalPlayer != null && e.Attacker.Owner.Stances[e.Attacker.World.LocalPlayer] == Stance.Ally) + if (bounty > 0 && e.Attacker.Owner.IsAlliedWith(self.World.RenderPlayer)) e.Attacker.World.AddFrameEndTask(w => w.Add(new CashTick(bounty, 20, 1, self.CenterLocation, e.Attacker.Owner.Color.RGB))); e.Attacker.Owner.PlayerActor.Trait().GiveCash(bounty); diff --git a/OpenRA.Mods.RA/OreRefinery.cs b/OpenRA.Mods.RA/OreRefinery.cs index 2023e951ca..a1069c7b9f 100644 --- a/OpenRA.Mods.RA/OreRefinery.cs +++ b/OpenRA.Mods.RA/OreRefinery.cs @@ -92,7 +92,7 @@ namespace OpenRA.Mods.RA if (Info.ShowTicks && currentDisplayValue > 0 && --currentDisplayTick <= 0) { var temp = currentDisplayValue; - if (self.World.LocalPlayer != null && self.Owner.Stances[self.World.LocalPlayer] == Stance.Ally) + if (self.Owner.IsAlliedWith(self.World.RenderPlayer)) self.World.AddFrameEndTask(w => w.Add(new CashTick(temp, Info.TickLifetime, Info.TickVelocity, self.CenterLocation, self.Owner.Color.RGB))); currentDisplayTick = Info.TickRate; currentDisplayValue = 0;