Index: code/q3_ui/ui_demo2.c =================================================================== --- code/q3_ui/ui_demo2.c (revision 2143) +++ code/q3_ui/ui_demo2.c (working copy) @@ -70,7 +70,6 @@ menubitmap_s back; menubitmap_s go; - int numDemos; char names[NAMEBUFSIZE]; char *demolist[MAX_DEMOS]; @@ -120,7 +119,7 @@ int i, j; int len; char *demoname, extension[32]; - int protocol, protocolLegacy; + int demosToAdd; memset( &s_demos, 0 ,sizeof(demos_t) ); @@ -213,51 +212,32 @@ s_demos.list.itemnames = (const char **)s_demos.demolist; s_demos.list.columns = 3; - protocolLegacy = trap_Cvar_VariableValue("com_legacyprotocol"); - protocol = trap_Cvar_VariableValue("com_protocol"); - - if(!protocol) - protocol = trap_Cvar_VariableValue("protocol"); - if(protocolLegacy == protocol) - protocolLegacy = 0; - - Com_sprintf(extension, sizeof(extension), ".%s%d", DEMOEXT, protocol); - s_demos.numDemos = trap_FS_GetFileList("demos", extension, s_demos.names, ARRAY_LEN(s_demos.names)); - demoname = s_demos.names; - i = 0; - - for(j = 0; j < 2; j++) + + j=0; + while( demo_protocols[j] ) + { + Com_sprintf(extension, sizeof(extension), ".%s%d", DEMOEXT, demo_protocols[j] ); + demosToAdd = trap_FS_GetFileList("demos", extension, demoname, ARRAY_LEN(s_demos.names) - (demoname - s_demos.names) ); + + for(i=0; i < demosToAdd; i++) + { + s_demos.list.itemnames[ s_demos.list.numitems++ ] = demoname; + + len = strlen(demoname); + demoname += len + 1; + + if( s_demos.list.numitems >= MAX_DEMOS ) + break; + } + + if( s_demos.list.numitems >= MAX_DEMOS ) + break; + j++; + } + + if( 0 == s_demos.list.numitems ) { - if(s_demos.numDemos > MAX_DEMOS) - s_demos.numDemos = MAX_DEMOS; - - for(; i < s_demos.numDemos; i++) - { - s_demos.list.itemnames[i] = demoname; - - len = strlen(demoname); - - demoname += len + 1; - } - - if(!j) - { - if(protocolLegacy > 0 && s_demos.numDemos < MAX_DEMOS) - { - Com_sprintf(extension, sizeof(extension), ".%s%d", DEMOEXT, protocolLegacy); - s_demos.numDemos += trap_FS_GetFileList("demos", extension, demoname, - ARRAY_LEN(s_demos.names) - (demoname - s_demos.names)); - } - else - break; - } - } - - s_demos.list.numitems = s_demos.numDemos; - - if(!s_demos.numDemos) - { s_demos.list.itemnames[0] = "No Demos Found."; s_demos.list.numitems = 1; Index: code/qcommon/common.c =================================================================== --- code/qcommon/common.c (revision 2143) +++ code/qcommon/common.c (working copy) @@ -31,9 +31,6 @@ #include #endif -int demo_protocols[] = -{ 67, 66, 0 }; - #define MAX_NUM_ARGVS 50 #define MIN_DEDICATED_COMHUNKMEGS 1 Index: code/qcommon/q_shared.c =================================================================== --- code/qcommon/q_shared.c (revision 2143) +++ code/qcommon/q_shared.c (working copy) @@ -23,6 +23,9 @@ // q_shared.c -- stateless support routines that are included in each code dll #include "q_shared.h" +int demo_protocols[] = +{ 71, 68, 67, 66, 0 }; + float Com_Clamp( float min, float max, float value ) { if ( value < min ) { return min; Index: code/qcommon/q_shared.h =================================================================== --- code/qcommon/q_shared.h (revision 2143) +++ code/qcommon/q_shared.h (working copy) @@ -64,6 +64,14 @@ #define DEMOEXT "dm_" // standard demo extension +#define PROTOCOL_VERSION 71 +#define PROTOCOL_LEGACY_VERSION 68 +// 1.31 - 67 + +// maintain a list of compatible protocols for demo playing +// NOTE: that stuff only works with two digits protocols +extern int demo_protocols[]; + #ifdef _MSC_VER #pragma warning(disable : 4018) // signed/unsigned mismatch Index: code/qcommon/qcommon.h =================================================================== --- code/qcommon/qcommon.h (revision 2143) +++ code/qcommon/qcommon.h (working copy) @@ -243,23 +243,6 @@ qboolean Netchan_Process( netchan_t *chan, msg_t *msg ); - -/* -============================================================== - -PROTOCOL - -============================================================== -*/ - -#define PROTOCOL_VERSION 71 -#define PROTOCOL_LEGACY_VERSION 68 -// 1.31 - 67 - -// maintain a list of compatible protocols for demo playing -// NOTE: that stuff only works with two digits protocols -extern int demo_protocols[]; - #define UPDATE_SERVER_NAME "update.quake3arena.com" // override on command line, config files etc. #ifndef MASTER_SERVER_NAME