From: terencehill Date: Sun, 31 Mar 2019 11:53:54 +0000 (+0200) Subject: Small optimization X-Git-Tag: xonotic-v0.8.5~1565 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=00054ff9b89fe0dc07f0895649fefe1e41869b4e;p=xonotic%2Fxonotic-data.pk3dir.git Small optimization --- diff --git a/qcsrc/menu/xonotic/serverlist.qc b/qcsrc/menu/xonotic/serverlist.qc index 4421fce9b..11266b7c2 100644 --- a/qcsrc/menu/xonotic/serverlist.qc +++ b/qcsrc/menu/xonotic/serverlist.qc @@ -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);