Avoid a glitch when the HUD cursor gets (re)displayed
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud / hud.qc
index 0812ea4554647ca8cef700426e71974144447eaf..87ed2c4394be3d7721e10923b6ccd026e7c9d1f8 100644 (file)
@@ -698,10 +698,15 @@ void HUD_Main()
                HUD_Panel_Draw(HUD_PANEL(QUICKMENU));
        HUD_Panel_Draw(HUD_PANEL(SCOREBOARD));
 
-       bool cursor_active_prev = cursor_active;
+       int cursor_active_prev = cursor_active;
        cursor_active = HUD_WouldShowCursor();
        if (cursor_active_prev != cursor_active && autocvar_hud_cursormode)
+       {
                setcursormode(cursor_active);
+               // cursor inactive this frame, will be set to 1 the next frame
+               if (cursor_active)
+                       cursor_active = -1;
+       }
 
        if (intermission == 2)
                HUD_Reset();