From 3bbdab552809759951dcc8760cb348fa9fc5c1f5 Mon Sep 17 00:00:00 2001 From: JugadorXEI Date: Tue, 5 Aug 2025 23:00:54 +0200 Subject: [PATCH] Expose K_FlingPaperItem to Lua --- src/lua_baselib.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 59e2c40eb..6e5a13726 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -4318,6 +4318,21 @@ static int lib_kCreatePaperItem(lua_State *L) return 1; } +static int lib_kFlingPaperItem(lua_State *L) +{ + fixed_t x = luaL_checkfixed(L, 1); + fixed_t y = luaL_checkfixed(L, 2); + fixed_t z = luaL_checkfixed(L, 3); + angle_t angle = luaL_optinteger(L, 4, 0); + SINT8 flip = luaL_optinteger(L, 5, 0); + UINT8 type = luaL_optinteger(L, 6, 0); + UINT16 amount = luaL_optinteger(L, 7, 1); + NOHUD + INLEVEL + LUA_PushUserdata(L, K_FlingPaperItem(x, y, z, angle, flip, type, amount), META_MOBJ); + return 1; +} + static int lib_kPopPlayerShield(lua_State *L) { player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); @@ -5552,6 +5567,7 @@ static luaL_Reg lib[] = { {"K_KartUpdatePosition",lib_kKartUpdatePosition}, {"K_DropPaperItem",lib_kDropPaperItem}, {"K_CreatePaperItem",lib_kCreatePaperItem}, + {"K_FlingPaperItem",lib_kFlingPaperItem}, {"K_PopPlayerShield",lib_kPopPlayerShield}, {"K_DropHnextList",lib_kDropHnextList}, {"K_DropItems",lib_kDropItems},