]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix 2 cases of menu crash in the server list when there are no servers:
authorterencehill <piuntn@gmail.com>
Mon, 10 Jan 2011 18:49:32 +0000 (19:49 +0100)
committerterencehill <piuntn@gmail.com>
Mon, 10 Jan 2011 18:49:32 +0000 (19:49 +0100)
1. inserting for example SPACE in the address inputbox and then focusing the Join button
2. right clicking on the list box

qcsrc/menu/xonotic/serverlist.c

index 3d5d3e843cecb59fbc2a94d4bbecbc47ff68d455..0709d37c56e155e81d6b8a1435c8d504eee35336 100644 (file)
@@ -107,6 +107,8 @@ float IsFavorite(string srv)
        if(srv == "")
                return FALSE;
        srv = netaddress_resolve(srv, 26000);
+       if(srv == "")
+               return FALSE;
        p = crypto_getidfp(srv);
        n = tokenize_console(cvar_string("net_slist_favorites"));
        for(i = 0; i < n; ++i)
@@ -707,8 +709,11 @@ float XonoticServerList_keyDown(entity me, float scan, float ascii, float shift)
        }
        else if(scan == K_MOUSE2 || scan == K_SPACE)
        {
-               main.serverInfoDialog.loadServerInfo(main.serverInfoDialog, me.selectedItem);
-               DialogOpenButton_Click_withCoords(me, main.serverInfoDialog, org, sz);
+               if(me.nItems != 0)
+               {
+                       main.serverInfoDialog.loadServerInfo(main.serverInfoDialog, me.selectedItem);
+                       DialogOpenButton_Click_withCoords(me, main.serverInfoDialog, org, sz);
+               }
        }
        else if(scan == K_INS || scan == K_MOUSE3 || scan == K_KP_INS)
        {