Merge pull request #11778 from pchote/detect-sequence-length-mismatch

Fix bogus D2K grenadier sequences.
This commit is contained in:
Matthias Mailänder
2016-08-07 08:46:06 +02:00
committed by GitHub
2 changed files with 9 additions and 4 deletions

View File

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

View File

@@ -444,16 +444,16 @@ grenadier:
Tick: 120
die1: DATA.R8
Frames: 2694, 2701, 2708, 2715, 2722, 2729, 2736, 2743
Length: 19
Length: 8
die2: DATA.R8
Frames: 2695, 2702, 2709, 2716, 2723, 2730, 2737, 2744
Length: 19
Length: 8
die3: DATA.R8
Frames: 2696, 2703, 2710, 2717, 2724, 2731, 2738, 2745
Length: 19
Length: 8
die4: DATA.R8
Frames: 2697, 2704, 2711, 2718, 2725, 2732, 2738, 2746
Length: 19
Length: 8
die-crushed: DATA.R8
Frames: 2698, 2705, 2712, 2719, 2726, 2733, 2740, 2747
Tick: 800