]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/view.qc
Avoid a glitch when the HUD cursor gets (re)displayed
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / view.qc
index 5172731ffb32017af4246591362dc5ec10b9a517..e26f90894d7ce24f9df890eeeeca4223d3aa290c 100644 (file)
@@ -1592,6 +1592,15 @@ void HUD_Mouse(entity player)
                return;
        }
 
+       if (cursor_active == -1) // starting to display the cursor
+       {
+               // since HUD_Mouse is called by CSQC_UpdateView before CSQC_InputEvent,
+               // in the first frame mousepos is the mouse position of the last time
+               // the cursor was displayed, thus we ignore it to avoid a glictch
+               cursor_active = 1;
+               return;
+       }
+
        if(!autocvar_hud_cursormode)
                update_mousepos();