aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorludwig <ludwig@edf5b092-35ff-0310-97b2-ce42778d08ea>2006-12-30 16:16:25 +0000
committerludwig <ludwig@edf5b092-35ff-0310-97b2-ce42778d08ea>2006-12-30 16:16:25 +0000
commit148f86b3d35357bea3c7b981cbbc7a77e4e3fd56 (patch)
tree93fe32d7c3d64b7876f3eb45ae914a1faed52df6
parentf0fc390a026dfff392ba465b76f60f3f0e5a70e2 (diff)
downloadioquake3-aero-148f86b3d35357bea3c7b981cbbc7a77e4e3fd56.tar.gz
ioquake3-aero-148f86b3d35357bea3c7b981cbbc7a77e4e3fd56.zip
- also check for point release pak files
- make missing pak0 non fatal if fs_game != baseq3. This way total conversions like westernq3 work without Q3 data. git-svn-id: svn://svn.icculus.org/quake3/trunk@1024 edf5b092-35ff-0310-97b2-ce42778d08ea
-rw-r--r--code/qcommon/files.c76
1 files changed, 61 insertions, 15 deletions
diff --git a/code/qcommon/files.c b/code/qcommon/files.c
index df90588..f975f27 100644
--- a/code/qcommon/files.c
+++ b/code/qcommon/files.c
@@ -196,12 +196,20 @@ or configs will never get loaded from disk!
*/
-#define DEMOGAME "demota"
-
// every time a new demo pk3 file is built, this checksum must be updated.
// the easiest way to get it is to just run the game and see what it spits out
#define DEMO_PAK0_CHECKSUM 2985612116u
-#define PAK0_CHECKSUM 1566731103u
+static const unsigned pak_checksums[] = {
+ 1566731103u,
+ 298122907u,
+ 412165236u,
+ 2991495316u,
+ 1197932710u,
+ 4087071573u,
+ 3709064859u,
+ 908855077u,
+ 977125798u
+};
// if this is defined, the executable positively won't work with any paks other
// than the demo pak, even if productid is present. This is only used for our
@@ -2893,14 +2901,18 @@ Q3 media pak0.pk3, you'll want to remove this function
static void FS_CheckPak0( void )
{
searchpath_t *path;
- qboolean foundPak0 = qfalse;
+ qboolean founddemo = qfalse;
+ unsigned foundPak = 0;
for( path = fs_searchpaths; path; path = path->next ) {
- if( path->pack &&
- !Q_stricmpn( path->pack->pakBasename, "pak0", MAX_OSPATH ) &&
- (!Q_stricmpn( path->pack->pakGamename, BASEGAME, MAX_OSPATH ) ||
- !Q_stricmpn( path->pack->pakGamename, "demoq3", MAX_OSPATH ))) {
- foundPak0 = qtrue;
+ const char* pakBasename = path->pack->pakBasename;
+
+ if(!path->pack)
+ continue;
+
+ if(!Q_stricmpn( path->pack->pakGamename, "demoq3", MAX_OSPATH )
+ && !Q_stricmpn( pakBasename, "pak0", MAX_OSPATH )) {
+ founddemo = qtrue;
if( path->pack->checksum == DEMO_PAK0_CHECKSUM ) {
Com_Printf( "\n\n"
@@ -2909,22 +2921,56 @@ static void FS_CheckPak0( void )
"from the demo. This may work fine, but it is not\n"
"guaranteed or supported.\n"
"**************************************************\n\n\n" );
- } else if( path->pack->checksum != PAK0_CHECKSUM ) {
- Com_Printf( "\n\n"
+ }
+ } else if(!Q_stricmpn( path->pack->pakGamename, BASEGAME, MAX_OSPATH )
+ && strlen(pakBasename) == 4 && !Q_stricmpn( pakBasename, "pak", 3 )
+ && pakBasename[3] >= '0' && pakBasename[3] <= '8') {
+
+ if( path->pack->checksum != pak_checksums[pakBasename[3]-'0'] ) {
+ if(pakBasename[0] == '0') {
+ Com_Printf("\n\n"
"**************************************************\n"
"WARNING: pak0.pk3 is present but its checksum (%u)\n"
"is not correct. Please re-copy pak0.pk3 from your\n"
"legitimate Q3 CDROM.\n"
"**************************************************\n\n\n",
path->pack->checksum );
+ } else {
+ Com_Printf("\n\n"
+ "**************************************************\n"
+ "WARNING: pak%d.pk3 is present but its checksum (%u)\n"
+ "is not correct. Please re-install the point release\n"
+ "**************************************************\n\n\n",
+ pakBasename[3]-'0', path->pack->checksum );
+ }
}
+
+ foundPak |= 1<<(pakBasename[3]-'0');
}
}
- if( !foundPak0 ) {
- Com_Error( ERR_FATAL, "Couldn't find pak0.pk3. Check that your Q3\n"
- "executable is in the correct place and that every file\n"
- "in the %s directory is present and readable.", BASEGAME);
+ if( !founddemo && foundPak != 0x1ff ) {
+ if((foundPak&1) != 1 ) {
+ Com_Printf("\n\n"
+ "pak0.pk3 is missing. Please copy it\n"
+ "from your legitimate Q3 CDROM.\n");
+ }
+
+ if((foundPak&0x1fe) != 0x1fe ) {
+ Com_Printf("\n\n"
+ "Point Release files are missing. Please\n"
+ "re-install the 1.32 point release.\n");
+ }
+
+ Com_Printf("\n\n"
+ "Also check that your Q3 executable is in\n"
+ "the correct place and that every file\n"
+ "in the %s directory is present and readable.\n", BASEGAME);
+
+ if(!fs_gamedirvar->string[0]
+ || !Q_stricmp( fs_gamedirvar->string, BASEGAME )
+ || !Q_stricmp( fs_gamedirvar->string, "missionpack" ))
+ Com_Error(ERR_FATAL, "\n*** you need to install Quake III Arena in order to play ***");
}
}