Make v.getSprite2Patch able to fallback to non-super sprites

This commit is contained in:
Lactozilla 2025-01-18 14:57:09 -03:00
parent a67a6ca3b8
commit 52b88d63fe

View file

@ -613,6 +613,10 @@ static int libd_getSprite2Patch(lua_State *L)
if (super) if (super)
j |= SPR2F_SUPER; j |= SPR2F_SUPER;
// If there is no "super" variation of this sprite, try with the normal one.
if (!P_IsValidSprite2(skins[i], j))
j &= ~SPR2F_SUPER;
sprdef = P_GetSkinSpritedef(skins[i], j); sprdef = P_GetSkinSpritedef(skins[i], j);
// set frame number // set frame number