From: terencehill Date: Fri, 22 Apr 2016 17:28:09 +0000 (+0200) Subject: Use the old hack (now fixed) instead of checking Menu_Active to prevent cursor from... X-Git-Tag: xonotic-v0.8.2~932^2~9 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4d32fd74a097714d962e8f7156f3aafbc6eb25c8;p=xonotic%2Fxonotic-data.pk3dir.git Use the old hack (now fixed) instead of checking Menu_Active to prevent cursor from jumping to the upper left corner when hiding the menu; it's better because it now works when showing the console too --- diff --git a/qcsrc/menu/menu.qc b/qcsrc/menu/menu.qc index 913cdbe34..bde7fbe28 100644 --- a/qcsrc/menu/menu.qc +++ b/qcsrc/menu/menu.qc @@ -790,15 +790,11 @@ void m_draw(float width, float height) draw_alpha *= menuAlpha; - if (!Menu_Active) + if (menuMouseMode) { - // do not update mouse position - // it prevents mouse jumping to '0 0 0' when menu is fading out - } - else if (menuMouseMode) - { - vector newMouse = globalToBox(getmousepos(), draw_shift, draw_scale); - if (newMouse != '0 0 0' && newMouse != menuMousePos) + vector rawMousePos = getmousepos(); + vector newMouse = globalToBox(rawMousePos, draw_shift, draw_scale); + if (rawMousePos != '0 0 0' && newMouse != menuMousePos) { menuMousePos = newMouse; if (mouseButtonsPressed) main.mouseDrag(main, menuMousePos);