From 7ccdff6e121bdadfefbd0009ca3895474bb87c86 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Thu, 7 Feb 2013 21:03:33 -0600 Subject: [PATCH] Fix creating favorite when not on view favorite servers --- code/ui/ui_main.c | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/code/ui/ui_main.c b/code/ui/ui_main.c index 66a79421..e5025938 100644 --- a/code/ui/ui_main.c +++ b/code/ui/ui_main.c @@ -3481,28 +3481,26 @@ static void UI_RunMenuScript(char **args) { } } } else if (Q_stricmp(name, "createFavorite") == 0) { - if (ui_netSource.integer == UIAS_FAVORITES) { - char name[MAX_NAME_LENGTH]; - char addr[MAX_ADDRESSLENGTH]; - int res; + char name[MAX_NAME_LENGTH]; + char addr[MAX_ADDRESSLENGTH]; + int res; - name[0] = addr[0] = '\0'; - Q_strncpyz(name, UI_Cvar_VariableString("ui_favoriteName"), sizeof ( name ) ); - Q_strncpyz(addr, UI_Cvar_VariableString("ui_favoriteAddress"), sizeof ( addr ) ); - if (strlen(name) > 0 && strlen(addr) > 0) { - res = trap_LAN_AddServer(AS_FAVORITES, name, addr); - if (res == 0) { - // server already in the list - Com_Printf("Favorite already in list\n"); - } - else if (res == -1) { - // list full - Com_Printf("Favorite list full\n"); - } - else { - // successfully added - Com_Printf("Added favorite server %s\n", addr); - } + name[0] = addr[0] = '\0'; + Q_strncpyz(name, UI_Cvar_VariableString("ui_favoriteName"), sizeof ( name ) ); + Q_strncpyz(addr, UI_Cvar_VariableString("ui_favoriteAddress"), sizeof ( addr ) ); + if (strlen(name) > 0 && strlen(addr) > 0) { + res = trap_LAN_AddServer(AS_FAVORITES, name, addr); + if (res == 0) { + // server already in the list + Com_Printf("Favorite already in list\n"); + } + else if (res == -1) { + // list full + Com_Printf("Favorite list full\n"); + } + else { + // successfully added + Com_Printf("Added favorite server %s\n", addr); } } } else if (Q_stricmp(name, "orders") == 0) {