Don't add sprites to the sprite scene list if not used
Adding an unused sprite to the scene sprite list can cause crashes at compile time, as it tries to access "size" in an undefined sprite when looping the scene sprite list to calculate an offset for "Actor: Set Sprite Sheet".
@@ -1156,7 +1156,7 @@ export const precompileScenes = (
const spriteIndex = usedSprites.findIndex(
(sprite) => sprite.id === spriteId
);
- if (memo.indexOf(spriteIndex) === -1) {
+ if (spriteIndex !== -1 && memo.indexOf(spriteIndex) === -1) {
memo.push(spriteIndex);
}
return memo;
