Skip to content

Commit 27f5baa

Browse files
authored
Merge pull request #423 from YoYoGames/ghb-4415-audio-destroy-stream-return-val-feb24
audio_destroy_stream return value
2 parents 78cb00a + 25e1b46 commit 27f5baa

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

scripts/functions/Function_Sound.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,11 @@ function audio_update()
109109

110110
// Update and apply gains
111111
g_AudioGroups.forEach(_group => _group.gain.update());
112-
audio_sampledata.forEach(_asset => _asset.gain.update());
112+
audio_sampledata.forEach(_asset => {
113+
if (_asset != null) {
114+
_asset.gain.update();
115+
}
116+
});
113117
audio_sounds.forEach(_voice => _voice.updateGain());
114118
}
115119

@@ -3112,9 +3116,12 @@ function audio_destroy_stream(_soundid)
31123116
audio_stop_sound(_soundid);
31133117
audio_sampledata[_soundid] = null;
31143118
}
3119+
3120+
return 1;
31153121
}
3116-
}
31173122

3123+
return -1;
3124+
}
31183125

31193126
function allocateBufferSound( )
31203127
{

0 commit comments

Comments
 (0)