diff --git a/src/p_setup.c b/src/p_setup.c index 6d2c2d835..be1643558 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3507,11 +3507,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 @@ -3519,6 +3520,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++; } } diff --git a/src/sounds.c b/src/sounds.c index 687bfd687..0d2ca4499 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -1033,9 +1033,7 @@ sfxenum_t S_AddSoundFx(const char *name, boolean singular, INT32 flags, boolean S_sfx[i].skinsound = -1; S_sfx[i].usefulness = -1; - /// \todo if precached load it here if (S_PrecacheSound()){ - CONS_Printf("Precaching sounds...\n"); S_sfx[i].data = I_GetSfx(&S_sfx[i]); } else