about summary refs log tree commit diff
path: root/src/game/client/gc_client.cpp
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2008-03-18 01:35:05 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-03-18 01:35:05 +0000
commita3714edde118763b4784c63f098700f10132653c (patch)
treed6d1a74de9d75efbaf01c678ebbed37a7f0b14f1 /src/game/client/gc_client.cpp
parent944cd68addf377f794294391da6b291a41bc43f9 (diff)
downloadzcatch-a3714edde118763b4784c63f098700f10132653c.tar.gz
zcatch-a3714edde118763b4784c63f098700f10132653c.zip
fixed so that the screen doesn't blank when you aim in the middle
Diffstat (limited to 'src/game/client/gc_client.cpp')
-rw-r--r--src/game/client/gc_client.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/game/client/gc_client.cpp b/src/game/client/gc_client.cpp
index 4ef64f87..48712e5d 100644
--- a/src/game/client/gc_client.cpp
+++ b/src/game/client/gc_client.cpp
@@ -868,7 +868,6 @@ void render_game()
 		else
 		{
 			float l = length(mouse_pos);
-			if(l != l) l = 0; // detect division by zero
 			
 			if(l > mouse_max)
 			{
@@ -877,7 +876,8 @@ void render_game()
 			}
 
 			float offset_amount = max(l-deadzone, 0) * follow_factor;
-			camera_offset = normalize(mouse_pos)*offset_amount;
+			if(l > 0.0001f) // make sure that this isn't 0
+				camera_offset = normalize(mouse_pos)*offset_amount;
 		}
 	}