mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-01-31 04:50:48 +00:00
- put limits on A_SoundVolume
This commit is contained in:
parent
0e706bfecf
commit
5716dfe050
1 changed files with 6 additions and 0 deletions
|
@ -1761,6 +1761,12 @@ void S_RelinkSound (AActor *from, AActor *to)
|
|||
|
||||
bool S_ChangeSoundVolume(AActor *actor, int channel, float volume)
|
||||
{
|
||||
// don't let volume get out of bounds
|
||||
if (volume < 0.0)
|
||||
volume = 0.0;
|
||||
else if (volume > 1.0)
|
||||
volume = 1.0;
|
||||
|
||||
for (FSoundChan *chan = Channels; chan != NULL; chan = chan->NextChan)
|
||||
{
|
||||
if (chan->SourceType == SOURCE_Actor &&
|
||||
|
|
Loading…
Reference in a new issue