Skip to content

Commit 03edcaf

Browse files
lhofhanslparamat
authored andcommittedJul 2, 2018
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).
1 parent 1ff15d3 commit 03edcaf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎src/clientiface.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,10 @@ void RemoteClient::GetNextBlocks (
199199
// Distrust client-sent FOV and get server-set player object property
200200
// zoom FOV (degrees) as a check to avoid hacked clients using FOV to load
201201
// distant world.
202-
float prop_zoom_fov = sao->getZoomFOV() * core::DEGTORAD;
202+
// (zoom is disabled by value 0)
203+
float prop_zoom_fov = sao->getZoomFOV() < 0.001f ?
204+
0.0f :
205+
std::max(camera_fov, sao->getZoomFOV() * core::DEGTORAD);
203206

204207
const s16 full_d_max = std::min(adjustDist(m_max_send_distance, prop_zoom_fov),
205208
wanted_range);

0 commit comments

Comments
 (0)
Please sign in to comment.