Fix plat infinite sound loop (#825)

This commit is contained in:
Ryan Krafnick 2022-12-04 23:35:13 +01:00 committed by GitHub
parent c7e09871dd
commit 84aa5955d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 0 deletions

View File

@ -368,6 +368,7 @@ int EV_StopPlat(line_t* line)
plat_t *plat = pl->plat; // for one with the tag not in stasis
if (plat->status != in_stasis && plat->tag == line->tag)
{
S_StopLoop((mobj_t *)&plat->sector->soundorg);
plat->oldstatus = plat->status; // put it in stasis
plat->status = in_stasis;
plat->thinker.function.v = NULL;

View File

@ -488,6 +488,27 @@ void S_StopSound(const mobj_t *origin)
}
}
//
// S_StopLoop
//
void S_StopLoop(const mobj_t *origin)
{
int cnum;
//jff 1/22/98 return if sound is not enabled
if(nosfxparm)
return;
for(cnum = 0; cnum < numChannels; ++cnum)
{
if(channels[cnum].sfxinfo && channels[cnum].origin == origin && channels[cnum].loop)
{
S_StopChannel(cnum);
break;
}
}
}
// [FG] play sounds in full length
boolean full_sounds;
// [FG] removed map objects may finish their sounds

View File

@ -54,6 +54,7 @@ void S_LoopSound(const mobj_t *origin, int sound_id);
// Stop sound for thing at <origin>
void S_StopSound(const mobj_t *origin);
void S_StopLoop(const mobj_t *origin);
void S_StopLoopSounds(void);
// [FG] play sounds in full length