diff --git a/src/p_setup.c b/src/p_setup.c index d6c93ea5b..010a28fd3 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3508,11 +3508,12 @@ UINT16 P_PartialAddWadFile(const char *wadfilename, boolean local) for (i = 0; i < numlumps; i++, lumpinfo++) { name = lumpinfo->name; + lumpnum_t lumpnum = i|(wadnum<<16); if (name[0] == 'D') { if (name[1] == 'S') for (j = 1; j < NUMSFX; j++) { - if (S_sfx[j].name && !strnicmp(S_sfx[j].name, name + 2, 6)) + if (S_sfx[j].name && !strnicmp(S_sfx[j].name, name + 2, 6) && S_sfx[j].lumpnum != lumpnum && S_sfx[j].lumpnum != LUMPERROR) { // the sound will be reloaded when needed, // since sfx->data will be NULL @@ -3520,6 +3521,10 @@ UINT16 P_PartialAddWadFile(const char *wadfilename, boolean local) I_FreeSfx(&S_sfx[j]); + // Re-cache it + if (!sound_disabled && (M_CheckParm("-precachesound") || precachesound.value)) + S_sfx[j].data = I_GetSfx(&S_sfx[j]); + sreplaces++; } }