diff --git a/OpenRA.Mods.Common/Traits/EmitInfantryOnSell.cs b/OpenRA.Mods.Common/Traits/EmitInfantryOnSell.cs index 688e6d03d4..4045d40cd5 100644 --- a/OpenRA.Mods.Common/Traits/EmitInfantryOnSell.cs +++ b/OpenRA.Mods.Common/Traits/EmitInfantryOnSell.cs @@ -24,9 +24,9 @@ namespace OpenRA.Mods.Common.Traits [Desc("Be sure to use lowercase. Default value is \"e1\".")] public readonly string[] ActorTypes = { "e1" }; - [Desc("Spawns actors only if the selling player's race is in this list." + - "Leave empty to allow all races by default.")] - public readonly string[] Races = { }; + [Desc("Spawns actors only if the selling player's faction is in this list." + + "Leave empty to allow all factions by default.")] + public readonly string[] Factions = { }; public object Create(ActorInitializer init) { return new EmitInfantryOnSell(init.Self, this); } } @@ -34,20 +34,20 @@ namespace OpenRA.Mods.Common.Traits public class EmitInfantryOnSell : INotifySold { readonly EmitInfantryOnSellInfo info; - readonly bool correctRace = false; + readonly bool correctFaction; public EmitInfantryOnSell(Actor self, EmitInfantryOnSellInfo info) { this.info = info; - var raceList = info.Races; - correctRace = raceList.Length == 0 || raceList.Contains(self.Owner.Faction.InternalName); + var factionsList = info.Factions; + correctFaction = factionsList.Length == 0 || factionsList.Contains(self.Owner.Faction.InternalName); } public void Selling(Actor self) { } void Emit(Actor self) { - if (!correctRace) + if (!correctFaction) return; var csv = self.Info.Traits.GetOrDefault(); diff --git a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs index 1acce27b00..28a8e7cfee 100644 --- a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs +++ b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs @@ -1744,6 +1744,13 @@ namespace OpenRA.Mods.Common.UtilityCommands if (race != null) race.Key = "Factions"; } + + if (node.Key.StartsWith("EmitInfantryOnSell")) + { + var race = node.Value.Nodes.FirstOrDefault(x => x.Key == "Races"); + if (race != null) + race.Key = "Factions"; + } } UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1); diff --git a/mods/ts/rules/defaults.yaml b/mods/ts/rules/defaults.yaml index e61652ddb4..416f0e2dfa 100644 --- a/mods/ts/rules/defaults.yaml +++ b/mods/ts/rules/defaults.yaml @@ -88,10 +88,10 @@ UseDeathTypeSuffix: false EmitInfantryOnSell@gdi: ActorTypes: e1, e1, e2, medic - Races: gdi + Factions: gdi EmitInfantryOnSell@nod: ActorTypes: e1, e1, e1, e3, e3 - Races: nod + Factions: nod MustBeDestroyed: RequiredForShortGame: true CaptureNotification: