From 96d629cefd44d9394b6ea26c849581288dac9032 Mon Sep 17 00:00:00 2001 From: reaperrr Date: Thu, 4 May 2017 15:07:56 +0200 Subject: [PATCH] Upgrade rule for victim scan radii changes The game/engine now calculates the best values automatically and the field names have changed, so instead of renaming, we can just remove them under the assumption that only modders who really know what they're doing will ever use the override. --- OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs index 6199c126d1..715662e669 100644 --- a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs +++ b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs @@ -728,6 +728,20 @@ namespace OpenRA.Mods.Common.UtilityCommands } } + // Optimal victim scan radii are now calculated automatically + if (engineVersion < 20170505) + { + var targetExtraSearchRadius = node.Value.Nodes.FirstOrDefault(n => n.Key == "TargetSearchRadius" || n.Key == "TargetExtraSearchRadius"); + if (targetExtraSearchRadius != null) + { + Console.WriteLine("Warheads and projectiles now calculate the best victim search radius automatically."); + Console.WriteLine("If you absolutely need to override that for whatever reason, use the new fields:"); + Console.WriteLine("VictimScanRadius for warheads, BlockerScanRadius for projectiles,"); + Console.WriteLine("BounceBlockerScanRadius for bouncing Bullets and AreaVictimScanRadius for AreaBeams."); + node.Value.Nodes.Remove(targetExtraSearchRadius); + } + } + UpgradeWeaponRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1); } }