From bd0738c5c42242993cbc2fd75805f504208a92c3 Mon Sep 17 00:00:00 2001 From: Andrew Odintsov Date: Sun, 10 May 2020 21:53:27 +0100 Subject: [PATCH] Determine stance for spectators based on shroud selection --- OpenRA.Game/Player.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/OpenRA.Game/Player.cs b/OpenRA.Game/Player.cs index c2537e016a..8db71497bc 100644 --- a/OpenRA.Game/Player.cs +++ b/OpenRA.Game/Player.cs @@ -225,7 +225,11 @@ namespace OpenRA public Dictionary Stances = new Dictionary(); public bool IsAlliedWith(Player p) { - // Observers are considered allies to active combatants + // Current shroud selection is used to determine stance for spectators + if (p != null && p.Spectating && !NonCombatant && p.World.RenderPlayer != null) + return Stances[p.World.RenderPlayer] == Stance.Ally; + + // Observers are considered allies if RenderPlayer property is null return p == null || Stances[p] == Stance.Ally || (p.Spectating && !NonCombatant); }