Determine stance for spectators based on shroud selection

This commit is contained in:
Andrew Odintsov
2020-05-10 21:53:27 +01:00
committed by Paul Chote
parent 72c82cb080
commit bd0738c5c4

View File

@@ -225,7 +225,11 @@ namespace OpenRA
public Dictionary<Player, Stance> Stances = new Dictionary<Player, Stance>();
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);
}