r4666 - trunk/data/qcsrc/client

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Wed Oct 8 09:21:02 EDT 2008


Author: div0
Date: 2008-10-08 09:21:02 -0400 (Wed, 08 Oct 2008)
New Revision: 4666

Modified:
   trunk/data/qcsrc/client/View.qc
Log:
fix division by zero if cl_zoomfactor == 1


Modified: trunk/data/qcsrc/client/View.qc
===================================================================
--- trunk/data/qcsrc/client/View.qc	2008-10-08 13:15:43 UTC (rev 4665)
+++ trunk/data/qcsrc/client/View.qc	2008-10-08 13:21:02 UTC (rev 4666)
@@ -161,7 +161,12 @@
 		}
 	}
 
-	current_zoomfraction = (current_viewzoom - 1) / (1/zoomfactor - 1);
+	if(almost_equals(current_viewzoom, 1))
+		current_zoomfraction = 0;
+	else if(almost_equals(current_viewzoom, 1/zoomfactor))
+		current_zoomfraction = 1;
+	else
+		current_zoomfraction = (current_viewzoom - 1) / (1/zoomfactor - 1);
 
 	if(zoomsensitivity < 1)
 		setsensitivityscale(pow(current_viewzoom, 1 - zoomsensitivity));




More information about the nexuiz-commits mailing list