Expose P_MovePlayer to Lua.

This commit is contained in:
GoldenTails 2020-05-23 09:50:35 -05:00
parent 4b3d6f04f8
commit ada06910dc
3 changed files with 14 additions and 1 deletions

View file

@ -1360,6 +1360,17 @@ static int lib_pSpawnSkidDust(lua_State *L)
return 0;
}
static int lib_pMovePlayer(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
NOHUD
INLEVEL
if (!player)
return LUA_ErrInvalid(L, "player_t");
P_MovePlayer(player);
return 0;
}
static int lib_pDoPlayerFinish(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
@ -3386,6 +3397,7 @@ static luaL_Reg lib[] = {
{"P_BlackOw",lib_pBlackOw},
{"P_ElementalFire",lib_pElementalFire},
{"P_SpawnSkidDust", lib_pSpawnSkidDust},
{"P_MovePlayer",lib_pMovePlayer},
{"P_DoPlayerFinish",lib_pDoPlayerFinish},
{"P_DoPlayerExit",lib_pDoPlayerExit},
{"P_InstaThrust",lib_pInstaThrust},

View file

@ -177,6 +177,7 @@ void P_BlackOw(player_t *player);
void P_ElementalFire(player_t *player, boolean cropcircle);
void P_SpawnSkidDust(player_t *player, fixed_t radius, boolean sound);
void P_MovePlayer(player_t *player);
void P_DoPityCheck(player_t *player);
void P_PlayerThink(player_t *player);
void P_PlayerAfterThink(player_t *player);

View file

@ -7889,7 +7889,7 @@ static void P_SkidStuff(player_t *player)
//
// P_MovePlayer
static void P_MovePlayer(player_t *player)
void P_MovePlayer(player_t *player)
{
ticcmd_t *cmd;
INT32 i;