Expose P_ResetCamera to Lua

This commit is contained in:
SMS Alfredo 2023-06-02 23:04:18 -05:00
parent d6d424f102
commit 610effb8ea

View file

@ -1641,6 +1641,19 @@ static int lib_pHomingAttack(lua_State *L)
return 1;
}
static int lib_pResetCamera(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
camera_t *cam = *((camera_t **)luaL_checkudata(L, 2, META_CAMERA));
if (!player)
return LUA_ErrInvalid(L, "player_t");
if (!cam)
return LUA_ErrInvalid(L, "camera_t");
P_ResetCamera(player, cam);
return 0;
}
static int lib_pSuperReady(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
@ -4109,6 +4122,7 @@ static luaL_Reg lib[] = {
{"P_NukeEnemies",lib_pNukeEnemies},
{"P_Earthquake",lib_pEarthquake},
{"P_HomingAttack",lib_pHomingAttack},
{"P_ResetCamera",lib_pResetCamera},
{"P_SuperReady",lib_pSuperReady},
{"P_DoJump",lib_pDoJump},
{"P_SpawnThokMobj",lib_pSpawnThokMobj},