From b968b527d2d540522e5a8254a448d5ac6da96721 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 21 Feb 2015 12:31:39 +0000 Subject: [PATCH] Allow map players to use non-selectable races. --- OpenRA.Game/Player.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenRA.Game/Player.cs b/OpenRA.Game/Player.cs index 85c22df9d8..3cb52d7f53 100644 --- a/OpenRA.Game/Player.cs +++ b/OpenRA.Game/Player.cs @@ -46,10 +46,10 @@ namespace OpenRA public Shroud Shroud; public World World { get; private set; } - static CountryInfo ChooseCountry(World world, string name) + static CountryInfo ChooseCountry(World world, string name, bool requireSelectable = true) { var selectableCountries = world.Map.Rules.Actors["world"].Traits - .WithInterface().Where(c => c.Selectable) + .WithInterface().Where(c => !requireSelectable || c.Selectable) .ToList(); return selectableCountries.FirstOrDefault(c => c.Race == name) @@ -82,7 +82,7 @@ namespace OpenRA Playable = pr.Playable; Spectating = pr.Spectating; botType = pr.Bot; - Country = ChooseCountry(world, pr.Race); + Country = ChooseCountry(world, pr.Race, false); } PlayerActor = world.CreateActor("Player", new TypeDictionary { new OwnerInit(this) });