public Color PlayerStanceColor(Actor a)
{
var player = a.World.RenderPlayer ?? a.World.LocalPlayer;
if (player != null && !player.Spectating)
{
var apparentOwner = a.EffectiveOwner != null && a.EffectiveOwner.Disguised
? a.EffectiveOwner.Owner
: a.Owner;
if (a.Owner.IsAlliedWith(a.World.RenderPlayer))
apparentOwner = a.Owner;
if (apparentOwner == player)
return stanceColors.Self;
if (apparentOwner.IsAlliedWith(player))
return stanceColors.Allies;
if (!apparentOwner.NonCombatant)
return stanceColors.Enemies;
}
return stanceColors.Neutrals;
}