From 43cac2f051bc61e28ffad22db7dc9ccfa300044e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Mon, 27 Jan 2020 22:13:55 +0100 Subject: [PATCH] Don't complain about shadow frame length when there are none. --- OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs b/OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs index 3bbf417900..26d668f223 100644 --- a/OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs +++ b/OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs @@ -210,7 +210,7 @@ namespace OpenRA.Mods.Common.Graphics .F(sequence, animation, Start, Start + (Facings - 1) * Stride + Length - 1, frameCount - 1, info.Nodes[0].Location)); - if (ShadowStart + (Facings - 1) * Stride + Length > frameCount) + if (ShadowStart >= 0 && ShadowStart + (Facings - 1) * Stride + Length > frameCount) throw new InvalidOperationException( "{5}: Sequence {0}.{1}'s shadow frames use frames [{2}..{3}], but only [0..{4}] actually exist" .F(sequence, animation, ShadowStart, ShadowStart + (Facings - 1) * Stride + Length - 1, frameCount - 1,