Zooming the camera requires the 'zoom' privilege
authorBen Deutsch <ben@bendeutsch.de>
Tue, 2 Aug 2016 19:36:34 +0000 (21:36 +0200)
committerest31 <MTest31@outlook.com>
Wed, 10 Aug 2016 10:18:25 +0000 (12:18 +0200)
builtin/game/privileges.lua
src/camera.cpp

index 5838b937419fb0f5000703c02c2f5a4080ddf1e5..05c79440c75bde7c1fe9277f74da73fd9b8d78e4 100644 (file)
@@ -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,
+})
 
index e1d6dd91086eff9d785ebaed0a7250eb54f12c26..e1fec4a3e27a74d93ae28ce07959c8101655b03c 100644 (file)
@@ -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;