aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2019-11-09 00:27:50 +0100
committersfan5 <sfan5@live.de>2019-11-11 14:06:48 +0100
commit682b9de8246ce2c620f1cc5e4212e6378c2301ae (patch)
treee9ac5668c478938ac55fdf693bc83572f1c42eda
parentb57dc70769873e00ca7a7642862eb209a5528ce2 (diff)
downloadminetest-682b9de8246ce2c620f1cc5e4212e6378c2301ae.tar.gz
minetest-682b9de8246ce2c620f1cc5e4212e6378c2301ae.tar.bz2
minetest-682b9de8246ce2c620f1cc5e4212e6378c2301ae.zip
Fix camera:get_offset() in CSM
-rw-r--r--src/script/lua_api/l_camera.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/script/lua_api/l_camera.cpp b/src/script/lua_api/l_camera.cpp
index 80071b3b8..9c1470284 100644
--- a/src/script/lua_api/l_camera.cpp
+++ b/src/script/lua_api/l_camera.cpp
@@ -108,11 +108,10 @@ int LuaCamera::l_get_pos(lua_State *L)
int LuaCamera::l_get_offset(lua_State *L)
{
- Camera *camera = getobject(L, 1);
- if (!camera)
- return 0;
+ LocalPlayer *player = getClient(L)->getEnv().getLocalPlayer();
+ sanity_check(player);
- push_v3s16(L, camera->getOffset());
+ push_v3f(L, player->getEyeOffset() / BS);
return 1;
}