wire up bot creation properly in CreateMPPlayers etc

This commit is contained in:
Chris Forbes
2010-12-21 18:20:23 +13:00
parent 29fbeb2c5d
commit d320a689a2
4 changed files with 12 additions and 10 deletions

View File

@@ -59,10 +59,11 @@ namespace OpenRA.Mods.RA
var player = new Player(w, w.Map.Players[slot.MapPlayer], playerIndex++);
w.AddPlayer(player);
/* todo: only activate the bot option that's selected! */
/* activate the bot option that's selected! */
if (Game.IsHost)
foreach (var bot in player.PlayerActor.TraitsImplementing<IBot>())
bot.Activate(player);
player.PlayerActor.TraitsImplementing<IBot>()
.Single(b => b.Info.Name == slot.Bot)
.Activate(player);
/* a bit of a hack */
player.IsBot = true;