]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix #2893 "cl_zoomfactor 1 results in division by zero"; also simplify the current_vi...
authorterencehill <piuntn@gmail.com>
Sat, 20 Jan 2024 12:34:35 +0000 (13:34 +0100)
committerterencehill <piuntn@gmail.com>
Sat, 20 Jan 2024 12:34:35 +0000 (13:34 +0100)
qcsrc/client/view.qc

index a84d21ce87080b86cc44a709252b21c81faee8ea..689f4b4cecbdd80ad0c119f2c42fce5be85977bc 100644 (file)
@@ -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;