From: terencehill Date: Sat, 20 Jan 2024 12:34:35 +0000 (+0100) Subject: Fix #2893 "cl_zoomfactor 1 results in division by zero"; also simplify the current_vi... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9d8d9b4f7bc1ec9c8a3a9d36c08b90f193ca89ab;p=xonotic%2Fxonotic-data.pk3dir.git Fix #2893 "cl_zoomfactor 1 results in division by zero"; also simplify the current_viewzoom check (almost_equals performs redundant checks in this case) --- diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index a84d21ce8..689f4b4ce 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -481,7 +481,7 @@ vector GetCurrentFov(float fov) } } - if(almost_equals(current_viewzoom, 1)) + if(zoomfactor == 1 || current_viewzoom > 0.999) // zoomfactor check prevents a division by 0 current_zoomfraction = 0; else if(almost_equals(current_viewzoom, 1/zoomfactor)) current_zoomfraction = 1;