From a8dae724095463ba8c5e9866e13d50afc6ab6840 Mon Sep 17 00:00:00 2001 From: Pavel Penev Date: Fri, 31 Jul 2015 05:20:54 +0300 Subject: [PATCH] Clean `ProvidesPrerequisite.cs` of "race" --- .../Traits/Player/ProvidesPrerequisite.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/Player/ProvidesPrerequisite.cs b/OpenRA.Mods.Common/Traits/Player/ProvidesPrerequisite.cs index 3928c7f164..804708bc4c 100644 --- a/OpenRA.Mods.Common/Traits/Player/ProvidesPrerequisite.cs +++ b/OpenRA.Mods.Common/Traits/Player/ProvidesPrerequisite.cs @@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.Traits public readonly string[] RequiresPrerequisites = { }; [Desc("Only grant this prerequisite for certain factions.")] - public readonly string[] Race = { }; + public readonly string[] Factions = { }; [Desc("Should it recheck everything when it is captured?")] public readonly bool ResetOnOwnerChange = false; @@ -45,9 +45,9 @@ namespace OpenRA.Mods.Common.Traits if (string.IsNullOrEmpty(prerequisite)) prerequisite = init.Self.Info.Name; - var race = init.Contains() ? init.Get() : init.Self.Owner.Faction.InternalName; + var faction = init.Contains() ? init.Get() : init.Self.Owner.Faction.InternalName; - Update(init.Self.Owner, race); + Update(init.Self.Owner, faction); } public IEnumerable ProvidesPrerequisites @@ -67,12 +67,12 @@ namespace OpenRA.Mods.Common.Traits Update(newOwner, newOwner.Faction.InternalName); } - void Update(Player owner, string race) + void Update(Player owner, string faction) { enabled = true; - if (info.Race.Any()) - enabled = info.Race.Contains(race); + if (info.Factions.Any()) + enabled = info.Factions.Contains(faction); if (info.RequiresPrerequisites.Any() && enabled) enabled = owner.PlayerActor.Trait().HasPrerequisites(info.RequiresPrerequisites);