From 3c502579db600c0f32f18c3a2e480423df903b9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=A4rtens?= Date: Mon, 2 Jan 2023 14:03:11 +0100 Subject: [PATCH] fix crash when clamp mode is used by rearanging the parameters --- voxygen/src/session/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/voxygen/src/session/mod.rs b/voxygen/src/session/mod.rs index 6105c1246c..7a9a70ba40 100644 --- a/voxygen/src/session/mod.rs +++ b/voxygen/src/session/mod.rs @@ -454,7 +454,7 @@ impl PlayState for SessionState { let mut cam_dir = camera.get_orientation(); let cam_dir_clamp = (global_state.settings.gameplay.camera_clamp_angle as f32).to_radians(); - cam_dir.y = (-cam_dir_clamp).clamp(cam_dir.y, cam_dir_clamp); + cam_dir.y = cam_dir.y.clamp(-cam_dir_clamp, cam_dir_clamp); camera.set_orientation(cam_dir); }