mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-31 13:10:39 +00:00
- Exhumed: Avoid playing the same pickup sound while another copy of it is already active.
The pickup code here is not robust enough to play the sound only once per pickup.
This commit is contained in:
parent
4ee64df844
commit
b1d3e8ee54
2 changed files with 2 additions and 1 deletions
|
@ -751,7 +751,7 @@ void SetTorch(int nPlayer, int bTorchOnOff)
|
|||
}
|
||||
|
||||
if (bTorch) {
|
||||
PlayLocalSound(StaticSound[kSoundTorchOn], 0);
|
||||
PlayLocalSound(StaticSound[kSoundTorchOn], 0, CHANF_UI);
|
||||
}
|
||||
|
||||
const char* buf = bTorch ? "TXT_EX_TORCHLIT" : "TXT_EX_TORCHOUT";
|
||||
|
|
|
@ -294,6 +294,7 @@ void PlayLocalSound(int nSound, int nRate, bool unattached, EChanFlags cflags)
|
|||
FSoundChan* chan;
|
||||
if (!unattached)
|
||||
{
|
||||
if (!(cflags & CHANF_UI) && soundEngine->IsSourcePlayingSomething(SOURCE_None, nullptr, CHAN_BODY, nSound + 1)) return;
|
||||
soundEngine->StopSound(SOURCE_None, nullptr, CHAN_BODY);
|
||||
chan = soundEngine->StartSound(SOURCE_None, nullptr, nullptr, CHAN_BODY, cflags, nSound + 1, 1.f, ATTN_NONE, nullptr);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue