Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
lhofhansl authored and paramat committed Jul 2, 2018
1 parent 1ff15d3 commit 03edcaf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/clientiface.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit 03edcaf

Please sign in to comment.