diff --git a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs index 636f2c55ba..7718eca762 100644 --- a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs +++ b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs @@ -477,6 +477,27 @@ namespace OpenRA.Mods.Common.UtilityCommands } } + if (engineVersion < 20161119) + { + // Migrated carryalls over to new conditions system + var carryableUpgradesNode = node.Value.Nodes.FirstOrDefault(n => n.Key == "CarryableUpgrades"); + if (carryableUpgradesNode != null) + { + var conditions = FieldLoader.GetValue("", carryableUpgradesNode.Value.Value); + if (conditions.Length > 1) + Console.WriteLine("Unable to automatically migrate {0}:{1} CarryableUpgrades to CarriedCondition. This must be corrected manually", + parent.Key, node.Key); + else + carryableUpgradesNode.Key = "CarriedCondition"; + } + + if (node.Key == "WithDecorationCarryable") + { + node.Key = "WithDecoration@CARRYALL"; + node.Value.Nodes.Add(new MiniYamlNode("RequiresCondition", "carryall-reserved")); + } + } + UpgradeActorRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1); } diff --git a/mods/d2k/rules/defaults.yaml b/mods/d2k/rules/defaults.yaml index 368100b356..dcdaceff41 100644 --- a/mods/d2k/rules/defaults.yaml +++ b/mods/d2k/rules/defaults.yaml @@ -159,11 +159,12 @@ Voiced: VoiceSet: VehicleVoice AutoCarryable: - CarryableUpgrades: notmobile - WithDecorationCarryable: + CarriedCondition: notmobile + WithDecoration@CARRYALL: Image: pips Sequence: pickup-indicator Offset: -12, -12 + RequiresCondition: carryall-reserved ^Tank: Inherits: ^Vehicle