Merge pull request #9725 from atlimit8/InvalidOperationException-to-YamlException-in-Warhead-RulesetLoaded

Replace InvalidOperationException with YamlException in SpreadDamageWarhead
This commit is contained in:
abcdefg30
2015-10-23 14:11:21 +02:00

View File

@@ -35,11 +35,11 @@ namespace OpenRA.Mods.Common.Warheads
if (Range != null) if (Range != null)
{ {
if (Range.Length != 1 && Range.Length != Falloff.Length) if (Range.Length != 1 && Range.Length != Falloff.Length)
throw new InvalidOperationException("Number of range values must be 1 or equal to the number of Falloff values."); throw new YamlException("Number of range values must be 1 or equal to the number of Falloff values.");
for (var i = 0; i < Range.Length - 1; i++) for (var i = 0; i < Range.Length - 1; i++)
if (Range[i] > Range[i + 1]) if (Range[i] > Range[i + 1])
throw new InvalidOperationException("Range values must be specified in an increasing order."); throw new YamlException("Range values must be specified in an increasing order.");
} }
else else
Range = Exts.MakeArray(Falloff.Length, i => i * Spread); Range = Exts.MakeArray(Falloff.Length, i => i * Spread);