mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-18 02:21:47 +00:00
P_AddWadFile: for both WADs and pk3s, if a sound is found to replace an existing sound, don't go on looking for more with the same name (since there shouldn't be any)
This commit is contained in:
parent
03020036d4
commit
0e8db59f4b
1 changed files with 12 additions and 7 deletions
|
@ -3163,6 +3163,7 @@ void P_LoadSoundsRange(UINT16 wadnum, UINT16 first, UINT16 num)
|
||||||
CONS_Debug(DBG_SETUP, "Sound %.8s replaced\n", lumpinfo->name);
|
CONS_Debug(DBG_SETUP, "Sound %.8s replaced\n", lumpinfo->name);
|
||||||
|
|
||||||
I_FreeSfx(&S_sfx[j]);
|
I_FreeSfx(&S_sfx[j]);
|
||||||
|
break; // there shouldn't be two sounds with the same name, so stop looking
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3290,17 +3291,21 @@ boolean P_AddWadFile(const char *wadfilename)
|
||||||
name = lumpinfo->name;
|
name = lumpinfo->name;
|
||||||
if (name[0] == 'D')
|
if (name[0] == 'D')
|
||||||
{
|
{
|
||||||
if (name[1] == 'S') for (j = 1; j < NUMSFX; j++)
|
if (name[1] == 'S')
|
||||||
{
|
{
|
||||||
if (S_sfx[j].name && !strnicmp(S_sfx[j].name, name + 2, 6))
|
for (j = 1; j < NUMSFX; j++)
|
||||||
{
|
{
|
||||||
// the sound will be reloaded when needed,
|
if (S_sfx[j].name && !strnicmp(S_sfx[j].name, name + 2, 6))
|
||||||
// since sfx->data will be NULL
|
{
|
||||||
CONS_Debug(DBG_SETUP, "Sound %.8s replaced\n", name);
|
// the sound will be reloaded when needed,
|
||||||
|
// since sfx->data will be NULL
|
||||||
|
CONS_Debug(DBG_SETUP, "Sound %.8s replaced\n", name);
|
||||||
|
|
||||||
I_FreeSfx(&S_sfx[j]);
|
I_FreeSfx(&S_sfx[j]);
|
||||||
|
|
||||||
sreplaces++;
|
sreplaces++;
|
||||||
|
break; // there shouldn't be two sounds with the same name, so stop looking
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (name[1] == '_')
|
else if (name[1] == '_')
|
||||||
|
|
Loading…
Reference in a new issue