Allow SMLua to stop sounds (#549)

That's it
shoutouts to play_sound
This commit is contained in:
Cooliokid956 2023-12-03 09:26:43 -06:00 committed by Agent X
parent 2a36b14dcd
commit 8f0099cd85

View file

@ -2253,6 +2253,7 @@ void get_currently_playing_sound(u8 bank, u8 *numPlayingSounds, u8 *numSoundsInB
* Called from threads: thread5_game_loop
*/
void stop_sound(u32 soundBits, f32 *pos) {
pos = smlua_get_vec3f_for_play_sound(pos);
u8 bank = (soundBits & SOUNDARGS_MASK_BANK) >> SOUNDARGS_SHIFT_BANK;
if (bank >= SOUND_BANK_COUNT) { return; }
u8 soundIndex = sSoundBanks[bank][0].next;