From 28813702d67f5d56a7e29cb9473278dcc2ea750e Mon Sep 17 00:00:00 2001 From: Paramat Date: Sun, 15 Apr 2018 21:56:05 +0100 Subject: FOV: Raise lower limit to avoid zoom-loading of distant world (#7234) In the client, raise lower limit from 30 to 45 degrees, to avoid server seeing this as a zoom and loading world beyond the server-set limit. Add minimum in settingtypes.txt and enforce lower limit when set using minetest.conf. In the server, distrust the client-sent FOV if below the heuristic zoom threshold and use the player object property 'zoom_fov' to check it, to protect against hacked clients. --- src/content_sao.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/content_sao.cpp') diff --git a/src/content_sao.cpp b/src/content_sao.cpp index 3ea219846..c554b775d 100644 --- a/src/content_sao.cpp +++ b/src/content_sao.cpp @@ -1473,3 +1473,8 @@ bool PlayerSAO::getSelectionBox(aabb3f *toset) const return true; } + +float PlayerSAO::getZoomFOV() const +{ + return m_prop.zoom_fov; +} -- cgit v1.2.3