Expose P_ZMovement to Lua.

Because P_XYMovement wasn't enough.
This commit is contained in:
GoldenTails 2020-04-19 20:41:30 -05:00
parent 27c25bfa1e
commit 6d3a2919a2
3 changed files with 15 additions and 1 deletions

View file

@ -946,6 +946,18 @@ static int lib_pSceneryXYMovement(lua_State *L)
return 0;
}
static int lib_pZMovement(lua_State *L)
{
mobj_t *actor = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
NOHUD
INLEVEL
if (!actor)
return LUA_ErrInvalid(L, "mobj_t");
lua_pushboolean(L, P_ZMovement(actor));
return 1;
}
// P_USER
////////////
@ -3307,6 +3319,7 @@ static luaL_Reg lib[] = {
{"P_XYMovement",lib_pXYMovement},
{"P_RingXYMovement",lib_pRingXYMovement},
{"P_SceneryXYMovement",lib_pSceneryXYMovement},
{"P_ZMovement",lib_pZMovement},
// p_user
{"P_GetPlayerHeight",lib_pGetPlayerHeight},

View file

@ -2337,7 +2337,7 @@ boolean P_CheckSolidLava(ffloor_t *rover)
// P_ZMovement
// Returns false if the mobj was killed/exploded/removed, true otherwise.
//
static boolean P_ZMovement(mobj_t *mo)
boolean P_ZMovement(mobj_t *mo)
{
fixed_t dist, delta;
boolean onground;

View file

@ -473,6 +473,7 @@ void P_SetScale(mobj_t *mobj, fixed_t newscale);
void P_XYMovement(mobj_t *mo);
void P_RingXYMovement(mobj_t *mo);
void P_SceneryXYMovement(mobj_t *mo);
boolean P_ZMovement(mobj_t *mo);
void P_EmeraldManager(void);
extern INT32 modulothing;