mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-05-31 00:51:21 +00:00
- do not allow playing sounds during PlayerFinishLevel.
This gets called right before the level ends, any sound in here would play during the intermission or at the start of the next level.
This commit is contained in:
parent
c9833a811e
commit
b41ae2dfdd
3 changed files with 10 additions and 1 deletions
|
@ -378,7 +378,7 @@ FSoundChan *SoundEngine::StartSound(int type, const void *source,
|
|||
FVector3 pos, vel;
|
||||
FRolloffInfo *rolloff;
|
||||
|
||||
if (sound_id <= 0 || volume <= 0 || nosfx || nosound )
|
||||
if (sound_id <= 0 || volume <= 0 || nosfx || nosound || blockNewSounds)
|
||||
return NULL;
|
||||
|
||||
// prevent crashes.
|
||||
|
|
|
@ -238,6 +238,7 @@ protected:
|
|||
TArray<uint8_t> S_SoundCurve;
|
||||
TMap<int, int> ResIdMap;
|
||||
TArray<FRandomSoundList> S_rnd;
|
||||
bool blockNewSounds = false;
|
||||
|
||||
private:
|
||||
void LinkChannel(FSoundChan* chan, FSoundChan** head);
|
||||
|
@ -268,6 +269,11 @@ public:
|
|||
}
|
||||
void EvictAllChannels();
|
||||
|
||||
void BlockNewSounds(bool on)
|
||||
{
|
||||
blockNewSounds = on;
|
||||
}
|
||||
|
||||
virtual int SoundSourceIndex(FSoundChan* chan) { return 0; }
|
||||
virtual void SetSource(FSoundChan* chan, int index) {}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue