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>2007-12-16 20:31:33 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2007-12-16 20:31:33 +0000
commit00adf08412cc08733bb289babdc62a1ea95d42d0 (patch)
tree0cd538e0f6b5d518f93a49b575ae4b3085389bec /src/game/client/gc_client.cpp
parentb03d26b8866e04567f21cee3fcd37a9ca673ea3b (diff)
downloadzcatch-00adf08412cc08733bb289babdc62a1ea95d42d0.tar.gz
zcatch-00adf08412cc08733bb289babdc62a1ea95d42d0.zip
fixed spectate clamping
Diffstat (limited to 'src/game/client/gc_client.cpp')
-rw-r--r--src/game/client/gc_client.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/game/client/gc_client.cpp b/src/game/client/gc_client.cpp
index 03b3a24c..4e0219ff 100644
--- a/src/game/client/gc_client.cpp
+++ b/src/game/client/gc_client.cpp
@@ -2323,7 +2323,14 @@ void render_game()
 		int x, y;
 		inp_mouse_relative(&x, &y);
 		mouse_pos += vec2(x, y);
-		if(!spectate)
+		if(spectate)
+		{
+			if(mouse_pos.x < 200.0f) mouse_pos.x = 200.0f;
+			if(mouse_pos.y < 200.0f) mouse_pos.y = 200.0f;
+			if(mouse_pos.x > col_width()*32-200.0f) mouse_pos.x = col_width()*32-200.0f;
+			if(mouse_pos.y > col_height()*32-200.0f) mouse_pos.y = col_height()*32-200.0f;
+		}
+		else
 		{
 			float l = length(mouse_pos);
 			if(l > 600.0f)