From a87805a9445f280ca71da322c4b32cf357744511 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Tue, 23 Jun 2020 17:43:47 +0200 Subject: test --- src/script/lua_api/l_localplayer.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/script/lua_api/l_localplayer.cpp') diff --git a/src/script/lua_api/l_localplayer.cpp b/src/script/lua_api/l_localplayer.cpp index 821b1cb66..3538c4fe4 100644 --- a/src/script/lua_api/l_localplayer.cpp +++ b/src/script/lua_api/l_localplayer.cpp @@ -217,6 +217,15 @@ int LuaLocalPlayer::l_get_pos(lua_State *L) return 1; } +int LuaLocalPlayer::l_set_pos(lua_State *L) +{ + LocalPlayer *player = getobject(L, 1); + + v3f pos = checkFloatPos(L, 2); + player->setPosition(pos); + return 0; +} + int LuaLocalPlayer::l_get_movement_acceleration(lua_State *L) { LocalPlayer *player = getobject(L, 1); @@ -423,6 +432,7 @@ const luaL_Reg LuaLocalPlayer::methods[] = { luamethod(LuaLocalPlayer, get_key_pressed), luamethod(LuaLocalPlayer, get_breath), luamethod(LuaLocalPlayer, get_pos), + luamethod(LuaLocalPlayer, set_pos), luamethod(LuaLocalPlayer, get_movement_acceleration), luamethod(LuaLocalPlayer, get_movement_speed), luamethod(LuaLocalPlayer, get_movement), -- cgit v1.2.3