diff --git a/code/qcommon/files.c b/code/qcommon/files.c index 11d46aedc5..3962caeffe 100644 --- a/code/qcommon/files.c +++ b/code/qcommon/files.c @@ -3452,6 +3452,64 @@ static void FS_Startup( const char *gameName ) } #ifndef STANDALONE +/* +=================== +FS_AppendUserFriendlyPakList +=================== +*/ +static void FS_AppendUserFriendlyPakList( char *buf, size_t bufsize, int foundPakFiles, int numPakFiles ) +{ + int missingCount = 0; + int missingIndex = 0; + int missingMin = numPakFiles; + int missingMax = 0; + qboolean missingConsecutive = qtrue; + int i; + + for ( i = 0; i < numPakFiles; i++ ) { + if ( foundPakFiles & ( 1 << i ) ) { + continue; + } + + missingCount++; + + if ( missingMin > i ) { + missingMin = i; + } + if ( missingMax < i ) { + missingMax = i; + } + + if ( i > missingMin && ( foundPakFiles & ( 1<< ( i - 1 ) ) ) ) { + missingConsecutive = qfalse; + } + } + + if ( missingConsecutive && missingMax >= missingMin + 2 ) { + Q_strcat( buf, bufsize, + va( " \"pak%d.pk3\" through \"pak%d.pk3\"", + missingMin, missingMax ) ); + } else { + for ( i = 0; i < numPakFiles; i++ ) { + if ( foundPakFiles & (1< 0 && missingCount > 2 ) { + Q_strcat( buf, bufsize, "," ); + } + + if ( missingIndex == missingCount - 1 && missingCount > 1 ) { + Q_strcat( buf, bufsize, " and" ); + } + + Q_strcat( buf, bufsize, va( " \"pak%d.pk3\"", i ) ); + + missingIndex++; + } + } +} + /* =================== FS_CheckPak0 @@ -3600,24 +3658,24 @@ static void FS_CheckPak0( void ) } } - - if(!com_standalone->integer && (foundPak & 0x1ff) != 0x1ff) + if(!com_standalone->integer && (foundPak & ((1<string, PATH_SEP, BASEGAME, PATH_SEP)); + + Q_strcat(errorText, sizeof(errorText), + "Quake 3 must be purchased to legitimately obtain pak0. " + "Quake 3 1.32 point release files (pak1 through pak8) " + "are freely available at:\n\n" + "https://ioquake3.org/extras/patch-data/\n\n"); Q_strcat(errorText, sizeof(errorText), va("Also check that your ioq3 executable is in " @@ -3627,23 +3685,30 @@ static void FS_CheckPak0( void ) Com_Error(ERR_FATAL, "%s", errorText); } - if(!com_standalone->integer && foundTA && (foundTA & 0x0f) != 0x0f) + if(!com_standalone->integer && (foundTA & ((1<string, BASETA) || !Q_stricmp(fs_basegame->string, BASETA))) { char errorText[MAX_STRING_CHARS] = ""; - if((foundTA & 0x01) != 0x01) - { - Com_sprintf(errorText, sizeof(errorText), - "\"" BASETA "%cpak0.pk3\" is missing. Please copy it " - "from your legitimate Quake 3 Team Arena CDROM. ", PATH_SEP); - } + Q_strcat(errorText, sizeof(errorText), + "Quake 3 Team Arena data files are missing. Please copy"); - if((foundTA & 0x0e) != 0x0e) - { - Q_strcat(errorText, sizeof(errorText), - "Team Arena Point Release files are missing. Please " - "re-install the latest Team Arena point release."); - } + FS_AppendUserFriendlyPakList(errorText, sizeof(errorText), foundTA, NUM_TA_PAKS); + + Q_strcat(errorText, sizeof(errorText), + va(" from the \"%s\" directory in your Quake 3 Team Arena install or CD-ROM to:\n\n" + "%s%c%s%c\n\n", BASETA, fs_basepath->string, PATH_SEP, BASETA, PATH_SEP)); + + Q_strcat(errorText, sizeof(errorText), + "Quake 3 Team Arena must be purchased to legitimately obtain pak0. " + "Quake 3 Team Arena point release files (pak1 through pak3) " + "are freely available at:\n\n" + "https://ioquake3.org/extras/patch-data/\n\n"); + + Q_strcat(errorText, sizeof(errorText), + va("Also check that your ioq3 executable is in " + "the correct place and that every file " + "in the \"%s\" directory is present and readable", BASETA)); Com_Error(ERR_FATAL, "%s", errorText); } diff --git a/code/sys/sys_win32.c b/code/sys/sys_win32.c index d5e1c637b5..f5c888567b 100644 --- a/code/sys/sys_win32.c +++ b/code/sys/sys_win32.c @@ -724,6 +724,8 @@ Display an error message */ void Sys_ErrorDialog( const char *error ) { + Sys_Print( va( "%s\n", error ) ); + if( Sys_Dialog( DT_YES_NO, va( "%s. Copy console log to clipboard?", error ), "Error" ) == DR_YES ) {