Skip to content

Commit 682b9de

Browse files
committedNov 11, 2019
Fix camera:get_offset() in CSM
1 parent b57dc70 commit 682b9de

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed
 

Diff for: ‎src/script/lua_api/l_camera.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,10 @@ int LuaCamera::l_get_pos(lua_State *L)
108108

109109
int LuaCamera::l_get_offset(lua_State *L)
110110
{
111-
Camera *camera = getobject(L, 1);
112-
if (!camera)
113-
return 0;
111+
LocalPlayer *player = getClient(L)->getEnv().getLocalPlayer();
112+
sanity_check(player);
114113

115-
push_v3s16(L, camera->getOffset());
114+
push_v3f(L, player->getEyeOffset() / BS);
116115
return 1;
117116
}
118117

0 commit comments

Comments
 (0)
Please sign in to comment.