Skip to content

Commit

Permalink
Fix camera:get_offset() in CSM
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed Nov 11, 2019
1 parent b57dc70 commit 682b9de
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/script/lua_api/l_camera.cpp
Expand Up @@ -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;
}

Expand Down

0 comments on commit 682b9de

Please sign in to comment.