mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-10 23:01:59 +00:00
Disallow sound to be played on destroyed actors
It's possible for an actor to call Destroy() in a ZScript method (such as Tick()) and then subsequently call A_StartSound() to play a sound. Generally speaking this doesn't happen within a given class, but with a class hierarchy, Destroy() may be called unbeknownst to a mod developer. Even though checking bDestroyed is likely good practice, this ensures that sounds won't be started on actors flagged for cleanup.
This commit is contained in:
parent
e9af7e7096
commit
e281f992af
1 changed files with 2 additions and 1 deletions
|
@ -471,7 +471,8 @@ FSoundID DoomSoundEngine::ResolveSound(const void * ent, int type, FSoundID soun
|
|||
|
||||
static bool VerifyActorSound(AActor* ent, FSoundID& sound_id, int& channel, EChanFlags flags)
|
||||
{
|
||||
if (ent == nullptr || ent->Sector->Flags & SECF_SILENT || ent->Level != primaryLevel)
|
||||
if (ent == nullptr || ent->ObjectFlags & OF_EuthanizeMe || ent->Sector->Flags & SECF_SILENT ||
|
||||
ent->Level != primaryLevel)
|
||||
return false;
|
||||
|
||||
if ((flags & CHANF_MAYBE_LOCAL) && (compatflags & COMPATF_SILENTPICKUP))
|
||||
|
|
Loading…
Reference in a new issue