]> git.lizzy.rs Git - minetest.git/blobdiff - src/camera.cpp
Dungeongen: Fix out-of-voxelmanip access segfault
[minetest.git] / src / camera.cpp
index 4768e8778207bfd92c8de10b570395212312528b..a7679e43adb581eb88832176d0f5f4050041db94 100644 (file)
@@ -31,7 +31,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "event.h"
 #include "profiler.h"
 #include "util/numeric.h"
-#include "util/mathconstants.h"
 #include "constants.h"
 #include "fontengine.h"
 
@@ -394,8 +393,7 @@ void Camera::update(LocalPlayer* player, f32 frametime, f32 busytime,
        } else {
                fov_degrees = m_cache_fov;
        }
-       fov_degrees = MYMAX(fov_degrees, 10.0);
-       fov_degrees = MYMIN(fov_degrees, 170.0);
+       fov_degrees = rangelim(fov_degrees, 7.0, 160.0);
 
        // FOV and aspect ratio
        m_aspect = (f32) porting::getWindowSize().X / (f32) porting::getWindowSize().Y;