]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Small optimization
authorterencehill <piuntn@gmail.com>
Sun, 31 Mar 2019 11:53:54 +0000 (13:53 +0200)
committerterencehill <piuntn@gmail.com>
Sun, 31 Mar 2019 11:53:54 +0000 (13:53 +0200)
qcsrc/menu/xonotic/serverlist.qc

index 4421fce9b9153fe0acaa74e3e3584b096b6538d1..11266b7c2f9e35948574f54fbd3bd9c5b60e1373 100644 (file)
@@ -1095,11 +1095,6 @@ float XonoticServerList_mouseMove(entity me, vector pos)
 
 bool XonoticServerList_keyDown(entity me, int scan, bool ascii, bool shift)
 {
-       vector org, sz;
-
-       org = boxToGlobal(eY * (me.selectedItem * me.itemHeight - me.scrollPos), me.origin, me.size);
-       sz = boxToGlobalSize(eY * me.itemHeight + eX * (1 - me.controlWidth), me.size);
-
        if(scan == K_ENTER || scan == K_KP_ENTER)
        {
                ServerList_Connect_Click(NULL, me);
@@ -1109,6 +1104,8 @@ bool XonoticServerList_keyDown(entity me, int scan, bool ascii, bool shift)
        {
                if(me.nItems != 0)
                {
+                       vector org = boxToGlobal(eY * (me.selectedItem * me.itemHeight - me.scrollPos), me.origin, me.size);
+                       vector sz = boxToGlobalSize(eY * me.itemHeight + eX * (1 - me.controlWidth), me.size);
                        m_play_click_sound(MENU_SOUND_OPEN);
                        main.serverInfoDialog.loadServerInfo(main.serverInfoDialog, me.selectedItem);
                        DialogOpenButton_Click_withCoords(me, main.serverInfoDialog, org, sz);