]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fixed drifting mouse pointer problems in menu
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 8 May 2008 17:59:11 +0000 (17:59 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 8 May 2008 17:59:11 +0000 (17:59 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8293 d7cf8633-e32d-0410-b094-e92efae38249

clvm_cmds.c
mvm_cmds.c

index 83aa12a652f679689e1a7d49a03d48c0e9e3eb23..d00769327d90346fc0df844f5f83ed09ebc920c8 100644 (file)
@@ -1112,7 +1112,9 @@ static void VM_CL_getmousepos(void)
 {
        VM_SAFEPARMCOUNT(0,VM_CL_getmousepos);
 
-       if (cl.csqc_wantsmousemove)
+       if (key_consoleactive || key_dest != key_game)
+               VectorSet(PRVM_G_VECTOR(OFS_RETURN), 0, 0, 0);
+       else if (cl.csqc_wantsmousemove)
                VectorSet(PRVM_G_VECTOR(OFS_RETURN), in_windowmouse_x * vid_conwidth.integer / vid.width, in_windowmouse_y * vid_conheight.integer / vid.height, 0);
        else
                VectorSet(PRVM_G_VECTOR(OFS_RETURN), in_mouse_x * vid_conwidth.integer / vid.width, in_mouse_y * vid_conheight.integer / vid.height, 0);
index 34a0a22c007c50bc6137fb2e387b366f90bdfd91..91bb20074002c7417c3b87d8914a4dbcebe1dfb6 100644 (file)
@@ -790,7 +790,9 @@ static void VM_M_getmousepos(void)
 {
        VM_SAFEPARMCOUNT(0,VM_M_getmousepos);
 
-       if (in_client_mouse)
+       if (key_consoleactive || (key_dest != key_menu && key_dest != key_menu_grabbed))
+               VectorSet(PRVM_G_VECTOR(OFS_RETURN), 0, 0, 0);
+       else if (in_client_mouse)
                VectorSet(PRVM_G_VECTOR(OFS_RETURN), in_windowmouse_x * vid_conwidth.integer / vid.width, in_windowmouse_y * vid_conheight.integer / vid.height, 0);
        else
                VectorSet(PRVM_G_VECTOR(OFS_RETURN), in_mouse_x * vid_conwidth.integer / vid.width, in_mouse_y * vid_conheight.integer / vid.height, 0);