diff --git a/src/d_netfil.c b/src/d_netfil.c index 3deaeeab7..6bfcf2891 100644 --- a/src/d_netfil.c +++ b/src/d_netfil.c @@ -166,7 +166,7 @@ UINT8 *PutFileNeeded(UINT16 firstfile) for (; i < numwadfiles; i++) //mainwads+1, otherwise we start on the first mainwad { // If it has only music/sound lumps, don't put it in the list - if (i > mainwads && !wadfiles[i]->important) + if (!wadfiles[i]->important) continue; if (firstfile) @@ -175,6 +175,8 @@ UINT8 *PutFileNeeded(UINT16 firstfile) continue; } + // CONS_Printf("putting %d (%s) - mw %d\n", i, wadfiles[i]->filename, mainwads); + nameonly(strcpy(wadfilename, wadfiles[i]->filename)); // Look below at the WRITE macros to understand what these numbers mean. @@ -564,6 +566,9 @@ INT32 CL_CheckFiles(void) #endif for (i = 0; i < fileneedednum || j < numwadfiles;) { + // CONS_Printf("checking %d of %d / %d of %d?\n", i, fileneedednum, j, numwadfiles); + // CONS_Printf("i: %s / j: %s \n", fileneeded[i].filename, wadfiles[j]->filename); + if (j < numwadfiles && !wadfiles[j]->important) { // Unimportant on our side. @@ -574,11 +579,17 @@ INT32 CL_CheckFiles(void) // If this test is true, we've reached the end of one file list // and the other still has a file that's important if (i >= fileneedednum || j >= numwadfiles) + { return 2; + } + // For the sake of speed, only bother with a md5 check if (memcmp(wadfiles[j]->md5sum, fileneeded[i].md5sum, 16)) + { return 2; + } + // It's accounted for! let's keep going. CONS_Debug(DBG_NETPLAY, "'%s' accounted for\n", fileneeded[i].filename);