From bc695399930e3f319f0aee4d2290b344e4c915ec Mon Sep 17 00:00:00 2001 From: Taryn Hill Date: Tue, 3 Mar 2015 21:49:04 -0600 Subject: [PATCH] Clarify the error relating to too many frames defined in a sequence. --- OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs b/OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs index c5cc18f1e1..5286bb9210 100644 --- a/OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs +++ b/OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs @@ -155,11 +155,17 @@ namespace OpenRA.Mods.Common.Graphics "{0}: Sequence {1}.{2}: Length must be <= stride" .F(info.Nodes[0].Location, sequence, animation)); - if (Start < 0 || Start + Facings * Stride > sprites.Length || ShadowStart + Facings * Stride > sprites.Length) + if (Start < 0 || Start + Facings * Stride > sprites.Length) throw new InvalidOperationException( "{6}: Sequence {0}.{1} uses frames [{2}..{3}] of SHP `{4}`, but only 0..{5} actually exist" .F(sequence, animation, Start, Start + Facings * Stride - 1, src, sprites.Length - 1, - info.Nodes[0].Location)); + info.Nodes[0].Location)); + + if (ShadowStart + Facings * Stride > sprites.Length) + throw new InvalidOperationException( + "{6}: Sequence {0}.{1}'s shadow frames use frames [{2}..{3}] of SHP `{4}`, but only [0..{5}] actually exist" + .F(sequence, animation, ShadowStart, ShadowStart + Facings * Stride - 1, src, sprites.Length - 1, + info.Nodes[0].Location)); } catch (FormatException f) {