This commit is contained in:
Paul Chote
2011-06-21 03:40:39 +12:00
parent ce65127e34
commit 1cdfd44d43
2 changed files with 12 additions and 7 deletions

View File

@@ -60,12 +60,17 @@ namespace OpenRA.Mods.RA
if (p.PlayerReference.Enemies.Contains(q.InternalName))
return Stance.Enemy;
// Stances set via lobby teams
var pc = GetClientForPlayer(p);
var qc = GetClientForPlayer(q);
if (pc != null && qc != null)
return pc.Team != 0 && pc.Team == qc.Team
? Stance.Ally : Stance.Enemy;
// Hack: Map players share a ClientID with the host, so would
// otherwise take the host's team stance instead of being neutral
if (p.PlayerReference.Playable && q.PlayerReference.Playable)
{
// Stances set via lobby teams
var pc = GetClientForPlayer(p);
var qc = GetClientForPlayer(q);
if (pc != null && qc != null)
return pc.Team != 0 && pc.Team == qc.Team
? Stance.Ally : Stance.Enemy;
}
// Otherwise, default to neutral
return Stance.Neutral;