mirror of
https://github.com/ioquake/ioq3.git
synced 2024-11-10 07:11:46 +00:00
Fix going to previous browser source in q3_ui
It wasn't possible to go to previous source from favorites if sv_master5 cvar wasn't set.
This commit is contained in:
parent
c3e64d3806
commit
f4d68590c2
1 changed files with 9 additions and 2 deletions
|
@ -1102,15 +1102,22 @@ int ArenaServers_SetType( int type )
|
|||
if(type >= UIAS_GLOBAL1 && type <= UIAS_GLOBAL5)
|
||||
{
|
||||
char masterstr[2], cvarname[sizeof("sv_master1")];
|
||||
int direction;
|
||||
|
||||
while(type <= UIAS_GLOBAL5)
|
||||
if (type == g_servertype || type == ((g_servertype+1) % (ARRAY_LEN(master_items)-1))) {
|
||||
direction = 1;
|
||||
} else {
|
||||
direction = -1;
|
||||
}
|
||||
|
||||
while(type >= UIAS_GLOBAL1 && type <= UIAS_GLOBAL5)
|
||||
{
|
||||
Com_sprintf(cvarname, sizeof(cvarname), "sv_master%d", type - UIAS_GLOBAL0);
|
||||
trap_Cvar_VariableStringBuffer(cvarname, masterstr, sizeof(masterstr));
|
||||
if(*masterstr)
|
||||
break;
|
||||
|
||||
type++;
|
||||
type += direction;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue