From 580f1cfe97678281ebf855da3d99cefa392f4181 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sat, 9 Oct 2010 11:42:45 +1300 Subject: [PATCH] bot and humans hate each other, even if the host is on a team. --- OpenRA.Game/Player.cs | 3 ++- OpenRA.Mods.RA/CreateMPPlayers.cs | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/OpenRA.Game/Player.cs b/OpenRA.Game/Player.cs index 9cf4f2cf8f..d04d3d2e2f 100644 --- a/OpenRA.Game/Player.cs +++ b/OpenRA.Game/Player.cs @@ -37,7 +37,8 @@ namespace OpenRA public readonly int Index; public readonly bool NonCombatant = false; public readonly int ClientIndex; - public readonly PlayerReference PlayerRef; + public readonly PlayerReference PlayerRef; + public bool IsBot; public ShroudRenderer Shroud; public World World { get; private set; } diff --git a/OpenRA.Mods.RA/CreateMPPlayers.cs b/OpenRA.Mods.RA/CreateMPPlayers.cs index 0c196ec669..c6414c2ae3 100644 --- a/OpenRA.Mods.RA/CreateMPPlayers.cs +++ b/OpenRA.Mods.RA/CreateMPPlayers.cs @@ -63,6 +63,9 @@ namespace OpenRA.Mods.RA if (Game.IsHost) foreach (var bot in player.PlayerActor.TraitsImplementing()) bot.Activate(player); + + /* a bit of a hack */ + player.IsBot = true; } } @@ -86,6 +89,9 @@ namespace OpenRA.Mods.RA // Hack: All map players are neutral wrt everyone else if (p.Index < 0 || q.Index < 0) return Stance.Neutral; + if (p.IsBot ^ q.IsBot) + return Stance.Enemy; // bots and humans hate each other + var pc = GetClientForPlayer(p); var qc = GetClientForPlayer(q);