From 00adf08412cc08733bb289babdc62a1ea95d42d0 Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Sun, 16 Dec 2007 20:31:33 +0000 Subject: fixed spectate clamping --- src/game/client/gc_client.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/game/client/gc_client.cpp') 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) -- cgit 1.4.1