Add a bot type identifier.
This commit is contained in:
@@ -199,7 +199,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
|
||||
slotsButton.OnMouseDown = _ =>
|
||||
{
|
||||
var botNames = map.Rules.Actors["player"].TraitInfos<IBotInfo>().Select(t => t.Name);
|
||||
var botTypes = map.Rules.Actors["player"].TraitInfos<IBotInfo>().Select(t => t.Type);
|
||||
var options = new Dictionary<string, IEnumerable<DropDownOption>>();
|
||||
|
||||
var botController = orderManager.LobbyInfo.Clients.FirstOrDefault(c => c.IsAdmin);
|
||||
@@ -215,7 +215,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
{
|
||||
foreach (var slot in orderManager.LobbyInfo.Slots)
|
||||
{
|
||||
var bot = botNames.Random(Game.CosmeticRandom);
|
||||
var bot = botTypes.Random(Game.CosmeticRandom);
|
||||
var c = orderManager.LobbyInfo.ClientInSlot(slot.Key);
|
||||
if (slot.Value.AllowBots == true && (c == null || c.Bot != null))
|
||||
orderManager.IssueOrder(Order.Command("slot_bot {0} {1} {2}".F(slot.Key, botController.Index, bot)));
|
||||
@@ -621,7 +621,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
if (addBotOnMapLoad)
|
||||
{
|
||||
var slot = orderManager.LobbyInfo.FirstEmptyBotSlot();
|
||||
var bot = currentMap.Rules.Actors["player"].TraitInfos<IBotInfo>().Select(t => t.Name).FirstOrDefault();
|
||||
var bot = currentMap.Rules.Actors["player"].TraitInfos<IBotInfo>().Select(t => t.Type).FirstOrDefault();
|
||||
var botController = orderManager.LobbyInfo.Clients.FirstOrDefault(c => c.IsAdmin);
|
||||
if (slot != null && bot != null)
|
||||
orderManager.IssueOrder(Order.Command("slot_bot {0} {1} {2}".F(slot, botController.Index, bot)));
|
||||
|
||||
Reference in New Issue
Block a user