OpenDR
OpenDR copied to clipboard
Shooting in the 1 o'clock direction causes a crash in DefaultSpriteSequence
When shooting in the 1 o'clock direction (or north north-east), an exception occurs due to a large facing value. This only seems to happen for sprites with 24 facings and multiple animation frames.

Culprit sequences are: eolaspr2.spr, eorgnpr0.spr, eorgnpr1.spr. The default laser weapon used by the base troop Raider (FG) or Guardian (Imperium) will do it.
Currently I'm addressing this with a copy of DefaultSpriteSequence: HackySpriteSequence. Line 345 contains a hack to always choose a valid facing.
// TODO: DR hack!
int newIndex = start + i;
if (newIndex >= sprites.Length)
newIndex = sprites.Length - 1;
To reproduce, place a breakpoint in the block above (line 345, HackySpriteSequence.cs), start the game, go to Single Player, Missions, Mission Test, select a Raider, and force fire in the 1 o'clock direction.
This can be reproduced in RA by doing the following:
- Download buggedprojectile.zip and extract the .shp file into the bits folder.
- Add the following lines to sequences/misc.yaml:
buggedprojectile:
idle:
Length: 3
Facings: 24
- Edit weapons/ballistics.yaml and alter 25mm like so:
25mm:
[...]
Projectile: Bullet
[...]
Image: BUGGEDPROJECTILE
- Play a skirmish and build a light tank. Shoot in the 1 o'clock direction.