Merge branch 'xMAC94x/fix_crash' into 'master'

fix crash when clamp mode is used by using min().max() rather than clamp

See merge request veloren/veloren!3742
This commit is contained in:
Marcel 2023-01-02 16:33:16 +00:00
commit edb34116b4

View File

@ -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);
}