diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 25fa38769..dddbea0ee 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -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},