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();
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();