From: Ben Deutsch Date: Tue, 2 Aug 2016 19:36:34 +0000 (+0200) Subject: Zooming the camera requires the 'zoom' privilege X-Git-Tag: 0.4.15~284 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=82494b8cc199fb92248c6c30ce7ef18b7e7133ae;p=oweals%2Fminetest.git Zooming the camera requires the 'zoom' privilege --- diff --git a/builtin/game/privileges.lua b/builtin/game/privileges.lua index 5838b9374..05c79440c 100644 --- a/builtin/game/privileges.lua +++ b/builtin/game/privileges.lua @@ -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, +}) diff --git a/src/camera.cpp b/src/camera.cpp index e1d6dd910..e1fec4a3e 100644 --- a/src/camera.cpp +++ b/src/camera.cpp @@ -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;