File tree Expand file tree Collapse file tree 1 file changed +14
-24
lines changed Expand file tree Collapse file tree 1 file changed +14
-24
lines changed Original file line number Diff line number Diff line change @@ -1181,32 +1181,22 @@ function getFreeVoice(_props)
1181
1181
return null ;
1182
1182
}
1183
1183
1184
- function Audio_GetSound ( soundid )
1185
- {
1186
- var pSound = null ;
1187
- if ( soundid >= 0 && soundid <= audio_sampledata . length )
1188
- {
1189
- pSound = audio_sampledata [ soundid ] ;
1190
- }
1191
- else
1192
- {
1193
- var bufferSoundId = soundid - BASE_BUFFER_SOUND_INDEX ;
1194
- if ( bufferSoundId >= 0 && bufferSoundId < g_bufferSoundCount )
1195
- {
1196
- pSound = buffer_sampledata [ bufferSoundId ] ;
1197
- }
1198
- else
1199
- {
1200
- var queueSoundId = soundid - BASE_QUEUE_SOUND_INDEX ;
1184
+ function Audio_GetSound ( soundid ) {
1185
+ if ( soundid >= 0 && soundid < audio_sampledata . length ) {
1186
+ return audio_sampledata [ soundid ] ;
1187
+ }
1201
1188
1202
- if ( queueSoundId >= 0 && queueSoundId < g_queueSoundCount )
1203
- {
1204
- pSound = queue_sampledata [ queueSoundId ] ;
1205
- }
1206
- }
1207
- }
1189
+ const bufferSoundId = soundid - BASE_BUFFER_SOUND_INDEX ;
1190
+ if ( bufferSoundId >= 0 && bufferSoundId < g_bufferSoundCount ) {
1191
+ return buffer_sampledata [ bufferSoundId ] ;
1192
+ }
1193
+
1194
+ const queueSoundId = soundid - BASE_QUEUE_SOUND_INDEX ;
1195
+ if ( queueSoundId >= 0 && queueSoundId < g_queueSoundCount ) {
1196
+ return queue_sampledata [ queueSoundId ] ;
1197
+ }
1208
1198
1209
- return pSound ;
1199
+ return null ;
1210
1200
}
1211
1201
1212
1202
function Audio_GetEmitterOrThrow ( _emitterIndex ) {
You can’t perform that action at this time.
0 commit comments