Skip to content

Commit

Permalink
Zooming the camera requires the 'zoom' privilege
Browse files Browse the repository at this point in the history
  • Loading branch information
bendeutsch authored and est31 committed Aug 2, 2016
1 parent e285edb commit 2d3f08d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions builtin/game/privileges.lua
Expand Up @@ -54,4 +54,8 @@ core.register_privilege("noclip", {
give_to_singleplayer = false,
})
core.register_privilege("rollback", "Can use the rollback functionality")
core.register_privilege("zoom", {
description = "Can zoom the camera",
give_to_singleplayer = false,
})

2 changes: 1 addition & 1 deletion src/camera.cpp
Expand Up @@ -390,7 +390,7 @@ void Camera::update(LocalPlayer* player, f32 frametime, f32 busytime,

// Get FOV
f32 fov_degrees;
if (player->getPlayerControl().zoom) {
if (player->getPlayerControl().zoom && m_gamedef->checkLocalPrivilege("zoom")) {
fov_degrees = m_cache_zoom_fov;
} else {
fov_degrees = m_cache_fov;
Expand Down

0 comments on commit 2d3f08d

Please sign in to comment.