track selected server

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4027 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
ac_stef
2008-12-16 12:48:43 +00:00
parent d400ef2313
commit 7fe543397e
+6
View File
@@ -561,7 +561,13 @@ void refreshservers(void *menu, bool init)
checkresolver();
checkpings();
if(totalmillis - lastinfo >= servpingrate/(maxservpings ? (servers.length() + maxservpings - 1) / maxservpings : 1)) pingservers();
serverinfo *oldsel = NULL;
if(menu && servers.inrange(((gmenu *)menu)->menusel)) oldsel = servers[((gmenu *)menu)->menusel];
servers.sort(sicompare);
if(oldsel && oldsel->lastpingmillis - servermenumillis > 1000)
{
loopv(servers) if(servers[i] == oldsel) { ((gmenu *)menu)->menusel = i; break; }
}
if(menu)
{
static const char *title[NUMSERVSORT] =