]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/menu.qc
Use the old hack (now fixed) instead of checking Menu_Active to prevent cursor from...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / menu.qc
index e523a51937943b340b3e94f473c84e32b58753ae..bde7fbe281ce1423e7dc4448ec7ca0e8ebc2dafd 100644 (file)
@@ -671,6 +671,7 @@ void m_tooltip(vector pos)
 
 void m_draw(float width, float height)
 {
+       if (clientstate() == CS_DISCONNECTED) m_toggle(true);
        m_gamestatus();
 
        execute_next_frame();
@@ -789,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);
@@ -877,10 +874,10 @@ void m_toggle(int mode)
 void Shutdown()
 {
        m_hide();
-       FOREACH_ENTITY_ORDERED(it.destroy, LAMBDA(
+       FOREACH_ENTITY_ORDERED(it.destroy, {
                if (it.classname == "vtbl") continue;
                it.destroy(it);
-       ));
+       });
 }
 
 void m_focus_item_chain(entity outermost, entity innermost)