From: Samual Lenks Date: Thu, 10 Oct 2013 22:12:04 +0000 (-0400) Subject: Improve purity checks for category selection X-Git-Tag: xonotic-v0.8.0~256^2~27 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=07aaea740367a0708822165953b4ff54eac2cde8;p=xonotic%2Fxonotic-data.pk3dir.git Improve purity checks for category selection --- diff --git a/qcsrc/menu/xonotic/serverlist.c b/qcsrc/menu/xonotic/serverlist.c index 23e479767..3895d8732 100644 --- a/qcsrc/menu/xonotic/serverlist.c +++ b/qcsrc/menu/xonotic/serverlist.c @@ -64,10 +64,12 @@ entity makeXonoticServerList(); var float autocvar_menu_slist_categories = TRUE; var float autocvar_menu_slist_categories_onlyifmultiple = TRUE; var float autocvar_menu_slist_purethreshold = 10; +var float autocvar_menu_slist_modimpurity = 10; var float autocvar_menu_slist_recommendations = 2; +var float autocvar_menu_slist_recommendations_maxping = 150; var float autocvar_menu_slist_recommendations_minfreeslots = 1; var float autocvar_menu_slist_recommendations_minhumans = 1; -var float autocvar_menu_slist_recommendations_maxping = 150; +var float autocvar_menu_slist_recommendations_purethreshold = -1; //var string autocvar_menu_slist_recommended = "76.124.107.5:26004"; // server cache fields @@ -292,8 +294,7 @@ float CheckCategoryForEntry(float entry) } } - if(impure > autocvar_menu_slist_purethreshold) { impure = TRUE; } - else { impure = FALSE; } + if(modtype != "xonotic") { impure += autocvar_menu_slist_modimpurity; } // check if this server is favorited if(gethostcachenumber(SLIST_FIELD_ISFAVORITE, entry)) { return CAT_FAVORITED; } @@ -314,6 +315,12 @@ float CheckCategoryForEntry(float entry) if( (freeslots >= autocvar_menu_slist_recommendations_minfreeslots) && + ( + (autocvar_menu_slist_recommendations_purethreshold < 0) + || + (impure <= autocvar_menu_slist_recommendations_purethreshold) + ) + && ( gethostcachenumber(SLIST_FIELD_NUMHUMANS, entry) >= @@ -356,7 +363,7 @@ float CheckCategoryForEntry(float entry) } // must be normal or impure server - return (impure ? CAT_MODIFIED : CAT_NORMAL); + return ((impure > autocvar_menu_slist_purethreshold) ? CAT_MODIFIED : CAT_NORMAL); } float CheckItemNumber(float num)