summaryrefslogtreecommitdiff
path: root/src/clientiface.cpp
diff options
context:
space:
mode:
authorlhofhansl <lhofhansl@yahoo.com>2018-07-02 16:16:17 -0700
committerParamat <paramat@users.noreply.github.com>2018-07-03 00:16:17 +0100
commit03edcafdda550e55e29bf48a682097028ae01306 (patch)
tree4b890f2c026b08faaec392cc3870f0c9968158bb /src/clientiface.cpp
parent1ff15d3a46042d3432d9485249e4dc3b08dbc6ff (diff)
downloadminetest-03edcafdda550e55e29bf48a682097028ae01306.tar.gz
minetest-03edcafdda550e55e29bf48a682097028ae01306.tar.bz2
minetest-03edcafdda550e55e29bf48a682097028ae01306.zip
Zoom: Correctly verify client passed zoom at the server (#7526)
Fixes generation of distant world when not zooming in creative mode (in creative mode zoom FOV is 15 degrees).
Diffstat (limited to 'src/clientiface.cpp')
-rw-r--r--src/clientiface.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/clientiface.cpp b/src/clientiface.cpp
index cc52d1fbc..ba24af61f 100644
--- a/src/clientiface.cpp
+++ b/src/clientiface.cpp
@@ -199,7 +199,10 @@ void RemoteClient::GetNextBlocks (
// Distrust client-sent FOV and get server-set player object property
// zoom FOV (degrees) as a check to avoid hacked clients using FOV to load
// distant world.
- float prop_zoom_fov = sao->getZoomFOV() * core::DEGTORAD;
+ // (zoom is disabled by value 0)
+ float prop_zoom_fov = sao->getZoomFOV() < 0.001f ?
+ 0.0f :
+ std::max(camera_fov, sao->getZoomFOV() * core::DEGTORAD);
const s16 full_d_max = std::min(adjustDist(m_max_send_distance, prop_zoom_fov),
wanted_range);