From 52b88d63fe538249fb863f20bea3b6d0802c23bc Mon Sep 17 00:00:00 2001 From: Lactozilla Date: Sat, 18 Jan 2025 14:57:09 -0300 Subject: [PATCH] Make v.getSprite2Patch able to fallback to non-super sprites --- src/lua_hudlib.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index d2b3d9679..c8327658a 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -613,6 +613,10 @@ static int libd_getSprite2Patch(lua_State *L) if (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); // set frame number