From 83a87042f1e76c8b378b188e9389830e50de0e3d Mon Sep 17 00:00:00 2001
From: Steel Titanium <steeltitanium1@gmail.com>
Date: Sun, 8 Nov 2020 13:25:56 -0500
Subject: [PATCH] Push skin->sprites as light userdata

---
 src/lua_skinlib.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lua_skinlib.c b/src/lua_skinlib.c
index 1cd9df6310..d4d7bae127 100644
--- a/src/lua_skinlib.c
+++ b/src/lua_skinlib.c
@@ -217,7 +217,7 @@ static int skin_get(lua_State *L)
 		lua_pushinteger(L, skin->availability);
 		break;
 	case skin_sprites:
-		LUA_PushUserdata(L, skin->sprites, META_SKINSPRITES);
+		LUA_PushLightUserdata(L, skin->sprites, META_SKINSPRITES);
 		break;	
 	}
 	return 1;
@@ -340,7 +340,7 @@ static const char *const sprites_opt[] = {
 // skin.sprites[i] -> sprites[i]
 static int lib_getSkinSprite(lua_State *L)
 {
-	spritedef_t *sprites = *((spritedef_t **)luaL_checkudata(L, 1, META_SKINSPRITES));
+	spritedef_t *sprites = (spritedef_t *)luaL_checkudata(L, 1, META_SKINSPRITES);
 	playersprite_t i = luaL_checkinteger(L, 2);
 
 	if (i < 0 || i >= NUMPLAYERSPRITES*2)
-- 
GitLab