From 30e675a306c58283462f65dfcf1a0ac340fe8fea Mon Sep 17 00:00:00 2001 From: UberWaffe Date: Wed, 6 Aug 2014 10:01:45 +0200 Subject: [PATCH] Added YamlException to GiveUnitCrateAction if no units are defined. --- OpenRA.Mods.RA/Crates/GiveUnitCrateAction.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.RA/Crates/GiveUnitCrateAction.cs b/OpenRA.Mods.RA/Crates/GiveUnitCrateAction.cs index 2132d2e2f6..b9f42d047f 100644 --- a/OpenRA.Mods.RA/Crates/GiveUnitCrateAction.cs +++ b/OpenRA.Mods.RA/Crates/GiveUnitCrateAction.cs @@ -38,7 +38,12 @@ namespace OpenRA.Mods.RA.Crates readonly List usedCells = new List(); public GiveUnitCrateAction(Actor self, GiveUnitCrateActionInfo info) - : base(self, info) { Info = info; } + : base(self, info) + { + Info = info; + if (!Info.Units.Any()) + throw new YamlException("A GiveUnitCrateAction does not specify any units to give. This might be because the yaml is referring to 'Unit' rather than 'Units'."); + } public bool CanGiveTo(Actor collector) {