mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 17:01:51 +00:00
- fixed sound playback for doors etc.
The play code locked out the MUSICANDSFX actor but never properly checked for the sound being finished. Fixes #87
This commit is contained in:
parent
76ba45ac8d
commit
4332d02885
1 changed files with 13 additions and 3 deletions
|
@ -66,6 +66,16 @@ int callsound(int sn, int whatsprite)
|
|||
|
||||
int snum = sprite[i].lotag;
|
||||
auto flags = S_GetUserFlags(snum);
|
||||
|
||||
// Reset if the desired actor isn't playing anything.
|
||||
bool hival = S_IsSoundValid(sprite[i].hitag);
|
||||
if (hittype[i].temp_data[0] == 1 && !hival)
|
||||
{
|
||||
if (!S_CheckActorSoundPlaying(hittype[i].temp_data[5], snum))
|
||||
hittype[i].temp_data[0] = 0;
|
||||
}
|
||||
|
||||
|
||||
if (hittype[i].temp_data[0] == 0)
|
||||
{
|
||||
if ((flags & (SF_GLOBAL | SF_DTAG)) != SF_GLOBAL)
|
||||
|
@ -73,7 +83,7 @@ int callsound(int sn, int whatsprite)
|
|||
if (snum)
|
||||
{
|
||||
if (sprite[i].hitag && snum != sprite[i].hitag)
|
||||
S_StopSound(sprite[i].hitag, hittype[i].temp_data[5]); // changed to only stop the sound on the same actor, not all of them.
|
||||
S_StopSound(sprite[i].hitag, hittype[i].temp_data[5]);
|
||||
S_PlayActorSound(snum, whatsprite);
|
||||
hittype[i].temp_data[5] = whatsprite;
|
||||
}
|
||||
|
@ -82,10 +92,10 @@ int callsound(int sn, int whatsprite)
|
|||
hittype[i].temp_data[0] = 1;
|
||||
}
|
||||
}
|
||||
else if (S_IsSoundValid(sprite[i].hitag))
|
||||
else if (hival)
|
||||
{
|
||||
if ((flags & SF_LOOP) || (sprite[i].hitag && sprite[i].hitag != sprite[i].lotag))
|
||||
S_StopSound(sprite[i].lotag, hittype[i].temp_data[5]); // changed to only stop the sound on the same actor, not all of them.
|
||||
S_StopSound(sprite[i].lotag, hittype[i].temp_data[5]);
|
||||
if (sprite[i].hitag) S_PlayActorSound(sprite[i].hitag, whatsprite);
|
||||
hittype[i].temp_data[0] = 0;
|
||||
hittype[i].temp_data[5] = whatsprite;
|
||||
|
|
Loading…
Reference in a new issue