mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 23:02:03 +00:00
Fix MUSICANDSFX ambient sounds (bit 2) playing only one instance.
This is done by introducing an additional internal bit, meaning "play only one instance". It is set for all sounds which have bit 1 ("repeat in the sound system") set at definesound time, but not those that set bit 1 temporarily (see r3336). git-svn-id: https://svn.eduke32.com/eduke32@3393 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
39ce7aee62
commit
898462152c
2 changed files with 9 additions and 3 deletions
|
@ -2122,7 +2122,9 @@ void C_DefineSound(int32_t sndidx, const char *fn, int32_t args[5])
|
|||
snd->ps = args[0];
|
||||
snd->pe = args[1];
|
||||
snd->pr = args[2];
|
||||
snd->m = args[3];
|
||||
snd->m = args[3] & ~32;
|
||||
if (args[3] & 1)
|
||||
snd->m |= 32;
|
||||
snd->vo = args[4];
|
||||
|
||||
if (sndidx > g_maxSoundPos)
|
||||
|
@ -5743,8 +5745,12 @@ repeatcase:
|
|||
g_sounds[k].pe = *(g_scriptPtr-1);
|
||||
C_GetNextValue(LABEL_DEFINE);
|
||||
g_sounds[k].pr = *(g_scriptPtr-1);
|
||||
|
||||
C_GetNextValue(LABEL_DEFINE);
|
||||
g_sounds[k].m = *(g_scriptPtr-1);
|
||||
g_sounds[k].m = *(g_scriptPtr-1) & ~32;
|
||||
if (*(g_scriptPtr-1) & 1)
|
||||
g_sounds[k].m |= 32;
|
||||
|
||||
C_GetNextValue(LABEL_DEFINE);
|
||||
g_sounds[k].vo = *(g_scriptPtr-1);
|
||||
g_scriptPtr -= 5;
|
||||
|
|
|
@ -657,7 +657,7 @@ int32_t S_PlaySound3D(int32_t num, int32_t i, const vec3_t *pos)
|
|||
|
||||
if (g_sounds[num].m&1)
|
||||
{
|
||||
if (g_sounds[num].num > 0)
|
||||
if ((g_sounds[num].m&32) && g_sounds[num].num > 0)
|
||||
{
|
||||
g_soundlocks[num]--;
|
||||
return -1;
|
||||
|
|
Loading…
Reference in a new issue