From 2b73fa027b3560fa1dfc2cd47905f9deb9202116 Mon Sep 17 00:00:00 2001 From: UberWaffe Date: Wed, 23 Jul 2014 16:36:51 +0200 Subject: [PATCH] Fixes as per comments. (+1 squashed commits) Squashed commits: [c3abf4b] Fixes as per comments. (+1 squashed commits) Squashed commits: [a289d17] Regression and UpgradeRules fix for #5921. --- OpenRA.Utility/UpgradeRules.cs | 12 ++++++++++++ mods/cnc/rules/misc.yaml | 7 ++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/OpenRA.Utility/UpgradeRules.cs b/OpenRA.Utility/UpgradeRules.cs index f1da09e260..064dd759f4 100644 --- a/OpenRA.Utility/UpgradeRules.cs +++ b/OpenRA.Utility/UpgradeRules.cs @@ -316,6 +316,18 @@ namespace OpenRA.Utility } } + // GiveUnitCrateAction and GiveMcvCrateAction were updated to allow multiple units + if (engineVersion < 20140723) + { + if (depth == 2 && parentKey.Contains("GiveMcvCrateAction")) + if (node.Key == "Unit") + node.Key = "Units"; + + if (depth == 2 && parentKey.Contains("GiveUnitCrateAction")) + if (node.Key == "Unit") + node.Key = "Units"; + } + UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1); } } diff --git a/mods/cnc/rules/misc.yaml b/mods/cnc/rules/misc.yaml index a724f2c0e1..c2cb588de3 100644 --- a/mods/cnc/rules/misc.yaml +++ b/mods/cnc/rules/misc.yaml @@ -17,10 +17,15 @@ CRATE: CloakCrateAction: SelectionShares: 5 Effect: cloak + DuplicateUnitCrateAction: + SelectionShares: 10 + MaxAmount: 5 + MinAmount: 1 + MaxDuplicatesWorth: 1250 GiveMcvCrateAction: SelectionShares: 0 NoBaseSelectionShares: 120 - Unit: mcv + Units: mcv RenderSprites: Palette: effect WithCrateBody: