From fe67781d682a4f532183c047d318bb527d0731c0 Mon Sep 17 00:00:00 2001 From: GoldenTails Date: Sun, 19 Apr 2020 18:41:03 -0500 Subject: [PATCH] Expose P_XYMovement to Lua. It was so easy; it took a grand total of one compile to implement! Why wasn't this done before... --- src/lua_baselib.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 2e05008ca..2cfc251ff 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -913,6 +913,17 @@ static int lib_pRailThinker(lua_State *L) return 1; } +static int lib_pXYMovement(lua_State *L) +{ + mobj_t *actor = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)); + NOHUD + INLEVEL + if (!actor) + return LUA_ErrInvalid(L, "mobj_t"); + P_XYMovement(actor); + return 0; +} + // P_USER //////////// @@ -3271,6 +3282,7 @@ static luaL_Reg lib[] = { {"P_CanRunOnWater",lib_pCanRunOnWater}, {"P_MaceRotate",lib_pMaceRotate}, {"P_RailThinker",lib_pRailThinker}, + {"P_XYMovement",lib_pXYMovement}, // p_user {"P_GetPlayerHeight",lib_pGetPlayerHeight},