diff options
author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-06-23 17:43:47 +0200 |
---|---|---|
committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-06-23 17:43:47 +0200 |
commit | a87805a9445f280ca71da322c4b32cf357744511 (patch) | |
tree | 0404bc58a6f556b0603283fdbd01121dc73d3cd9 /src/script/lua_api/l_localplayer.cpp | |
parent | 68f9263a24a345435d2310ab559ce8a811ef0427 (diff) | |
download | dragonfireclient-a87805a9445f280ca71da322c4b32cf357744511.tar.xz |
test
Diffstat (limited to 'src/script/lua_api/l_localplayer.cpp')
-rw-r--r-- | src/script/lua_api/l_localplayer.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
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), |