Allow repetition of frames in sequence setups.

This commit is contained in:
Matthias Mailänder
2020-01-27 22:13:35 +01:00
committed by reaperrr
parent d3291ea585
commit 39b7db2703

View File

@@ -204,7 +204,7 @@ namespace OpenRA.Mods.Common.Graphics
"{0}: Sequence {1}.{2}: Length must be <= Frames.Length" "{0}: Sequence {1}.{2}: Length must be <= Frames.Length"
.F(info.Nodes[0].Location, sequence, animation)); .F(info.Nodes[0].Location, sequence, animation));
if (Start < 0 || Start + (Facings - 1) * Stride + Length > frameCount) if (Frames == null && (Start < 0 || Start + (Facings - 1) * Stride + Length > frameCount))
throw new InvalidOperationException( throw new InvalidOperationException(
"{5}: Sequence {0}.{1} uses frames [{2}..{3}], but only 0..{4} actually exist" "{5}: Sequence {0}.{1} uses frames [{2}..{3}], but only 0..{4} actually exist"
.F(sequence, animation, Start, Start + (Facings - 1) * Stride + Length - 1, frameCount - 1, .F(sequence, animation, Start, Start + (Facings - 1) * Stride + Length - 1, frameCount - 1,