From 3b2efc7b0bdabd99ea207f498b82e3b39eb7ef8d Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sat, 24 Sep 2011 19:58:34 +1200 Subject: [PATCH] fix #1184 -- useless error message when forgetting to define Render:Image: on a derived actor type --- OpenRA.Game/Graphics/SequenceProvider.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OpenRA.Game/Graphics/SequenceProvider.cs b/OpenRA.Game/Graphics/SequenceProvider.cs index b8ace3a5ce..74c3a16cf3 100644 --- a/OpenRA.Game/Graphics/SequenceProvider.cs +++ b/OpenRA.Game/Graphics/SequenceProvider.cs @@ -59,6 +59,10 @@ namespace OpenRA.Graphics public static bool HasSequence(string unit, string seq) { + if (!units.ContainsKey(unit)) + throw new InvalidOperationException( + "Unit `{0}` does not have any sequences defined.".F(unit)); + return units[unit].ContainsKey(seq); } }