add a bot player, make ai apply to the bot not the local player

This commit is contained in:
mgatland
2010-08-15 22:23:34 +12:00
committed by alzeih
parent 19494c3262
commit 731c64c1a7
2 changed files with 13 additions and 3 deletions

View File

@@ -113,6 +113,8 @@ namespace OpenRA.Server
} }
} }
} ) { IsBackground = true }.Start(); } ) { IsBackground = true }.Start();
} }
static Session.Slot MakeSlotFromPlayerReference(PlayerReference pr) static Session.Slot MakeSlotFromPlayerReference(PlayerReference pr)

View File

@@ -48,7 +48,15 @@ namespace OpenRA.Mods.RA
public void GameStarted(World w) public void GameStarted(World w)
{ {
p = Game.world.LocalPlayer; try
{
p = Game.world.players.First(c => c.Value.PlayerName.Equals("bot")).Value;
}
catch (Exception)
{
//Could not find a bot.
}
//p = Game.world.LocalPlayer;
enabled = Game.IsHost && p != null; enabled = Game.IsHost && p != null;
if (enabled) if (enabled)
{ {