Fix #897.
This commit is contained in:
@@ -61,7 +61,7 @@ namespace OpenRA
|
||||
else
|
||||
{
|
||||
// Map player
|
||||
ClientIndex = 0; /* it's a map player, "owned" by host */
|
||||
ClientIndex = 0; // Owned by the host (todo: fix this)
|
||||
ColorRamp = pr.ColorRamp;
|
||||
PlayerName = pr.Name;
|
||||
NonCombatant = pr.NonCombatant;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user