Skip to content

Commit

Permalink
Move where MD5 hashes are checked
Browse files Browse the repository at this point in the history
  • Loading branch information
Lactozilla committed Mar 6, 2022
1 parent 114cb91 commit deab145
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 20 deletions.
16 changes: 0 additions & 16 deletions src/d_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1419,22 +1419,6 @@ void D_SRB2Main(void)
UnpackFile_ProgressClear();
#endif

#ifndef DEVELOP // md5s last updated 22/02/20 (ddmmyy)

// Check MD5s of autoloaded files
W_VerifyFileMD5(0, ASSET_HASH_SRB2_PK3); // srb2.pk3
W_VerifyFileMD5(1, ASSET_HASH_ZONES_PK3); // zones.pk3
W_VerifyFileMD5(2, ASSET_HASH_PLAYER_DTA); // player.dta
#ifdef USE_PATCH_DTA
W_VerifyFileMD5(3, ASSET_HASH_PATCH_PK3); // patch.pk3
#endif
#ifdef USE_ANDROID_PK3
W_VerifyFileMD5(4, ASSET_HASH_ANDROID_PK3); // android.pk3
#endif
// don't check music.dta because people like to modify it, and it doesn't matter if they do
// ...except it does if they slip maps in there, and that's what W_VerifyNMUSlumps is for.
#endif //ifndef DEVELOP

cht_Init();

//---------------------------------------------------- READY SCREEN
Expand Down
16 changes: 12 additions & 4 deletions src/w_wad.c
Original file line number Diff line number Diff line change
Expand Up @@ -1691,14 +1691,22 @@ void W_InitMultipleFiles(addfilelist_t *list, fhandletype_t handletype)
{
const char *fn = list->files[i];
char pathsep = fn[strlen(fn) - 1];
boolean mainfile = (numwadfiles < mainwads);

//CONS_Debug(DBG_SETUP, "Loading %s\n", fn);
boolean mainfile = numwadfiles < mainwads;

if (pathsep == '\\' || pathsep == '/')
W_InitFolder(fn, mainfile, true);
else
W_InitFile(fn, handletype, mainfile, true);
{
UINT16 status = W_InitFile(fn, handletype, mainfile, true);

#ifndef DEVELOP
// Check MD5s of autoloaded files
if (mainfile && status != INT16_MAX && list->hashes[i])
W_VerifyFileMD5(numwadfiles - 1, list->hashes[i]);
#else
(void)status;
#endif
}
}
}

Expand Down

0 comments on commit deab145

Please sign in to comment.