From 00ce9bcfa24a75eaa1d6e72e83ee3444c0b22565 Mon Sep 17 00:00:00 2001 From: JugadorXEI Date: Fri, 8 Aug 2025 01:40:07 +0200 Subject: [PATCH] Expose P_GivePlayerSpheres to Lua --- src/lua_baselib.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 5d5fc623e..8baaa9c7b 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -1680,6 +1680,18 @@ static int lib_pGivePlayerRings(lua_State *L) return 1; } +static int lib_pGivePlayerSpheres(lua_State *L) +{ + player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); + INT32 num_spheres = (INT32)luaL_checkinteger(L, 2); + NOHUD + INLEVEL + if (!player) + return LUA_ErrInvalid(L, "player_t"); + lua_pushinteger(L, P_GivePlayerSpheres(player, num_spheres)); + return 1; +} + static int lib_pGivePlayerLives(lua_State *L) { player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); @@ -5423,6 +5435,7 @@ static luaL_Reg lib[] = { {"P_SpawnGhostMobj",lib_pSpawnGhostMobj}, {"P_SpawnFakeShadow",lib_pSpawnFakeShadow}, {"P_GivePlayerRings",lib_pGivePlayerRings}, + {"P_GivePlayerSpheres",lib_pGivePlayerSpheres}, {"P_GivePlayerLives",lib_pGivePlayerLives}, {"P_MovePlayer",lib_pMovePlayer}, {"P_DoPlayerExit",lib_pDoPlayerExit},