Rename MPStartUnitsInfo.Races to Factions

Also add an upgrade rule.
This commit is contained in:
Pavel Penev
2015-08-11 04:00:08 +03:00
parent fd01e95d6c
commit 4d11195989
7 changed files with 39 additions and 32 deletions

View File

@@ -21,8 +21,8 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Exposed via the UI to the player.")]
public readonly string ClassName = "Unlabeled";
[Desc("Only available when selecting this faction.", "Leave empty for no restrictions.")]
public readonly string[] Races = { };
[Desc("Only available when selecting one of these factions.", "Leave empty for no restrictions.")]
public readonly string[] Factions = { };
[Desc("The mobile construction vehicle.")]
public readonly string BaseActor = null;

View File

@@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Traits
{
var spawnClass = p.PlayerReference.StartingUnitsClass ?? w.LobbyInfo.GlobalSettings.StartingUnitsClass;
var unitGroup = w.Map.Rules.Actors["world"].Traits.WithInterface<MPStartUnitsInfo>()
.Where(g => g.Class == spawnClass && g.Races != null && g.Races.Contains(p.Faction.InternalName))
.Where(g => g.Class == spawnClass && g.Factions != null && g.Factions.Contains(p.Faction.InternalName))
.RandomOrDefault(w.SharedRandom);
if (unitGroup == null)