From b3b6bb405bfa5b3aaba3ba8895090f6c640ee0c5 Mon Sep 17 00:00:00 2001 From: Samual Lenks Date: Wed, 9 Oct 2013 19:35:00 -0400 Subject: [PATCH] More cleanup, add todo for sanity check --- qcsrc/menu/xonotic/serverlist.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/qcsrc/menu/xonotic/serverlist.c b/qcsrc/menu/xonotic/serverlist.c index 8c823b5fb..b33d15b8b 100644 --- a/qcsrc/menu/xonotic/serverlist.c +++ b/qcsrc/menu/xonotic/serverlist.c @@ -334,13 +334,6 @@ float XonoticServerList_MapItems(float num) return FALSE; } -void ServerList_UpdateFieldIDs() -{ - #define SLIST_FIELD(suffix,name) SLIST_FIELD_##suffix = gethostcacheindexforkey(name); - SLIST_FIELDS - #undef SLIST_FIELD -} - void ToggleFavorite(string srv) { string s, s0, s1, s2, srv_resolved, p; @@ -410,8 +403,12 @@ void XonoticServerList_configureXonoticServerList(entity me) { me.configureXonoticListBox(me); - ServerList_UpdateFieldIDs(); + // update field ID's + #define SLIST_FIELD(suffix,name) SLIST_FIELD_##suffix = gethostcacheindexforkey(name); + SLIST_FIELDS + #undef SLIST_FIELD + // clear list me.nItems = 0; } void XonoticServerList_setSelected(entity me, float i) @@ -425,8 +422,10 @@ void XonoticServerList_setSelected(entity me, float i) */ if(me.nItems == 0) return; + //if(XonoticServerList_MapItems(gethostcachevalue(SLIST_HOSTCACHEVIEWCOUNT)) != me.nItems) // { error("^1XonoticServerList_setSelected(); ERROR: ^7Host cache viewcount mismatches nItems!\n"); return; } // sorry, it would be wrong + // todo: make this work somehow? ^ num = XonoticServerList_MapItems(me.selectedItem); if(num >= 0) -- 2.39.2