Fix music decoder playing garbage; close #8

This commit is contained in:
Dominic Szablewski 2023-08-13 22:12:29 +02:00
parent f29463132b
commit b484e85e7e

View file

@ -285,8 +285,9 @@ void sfx_music_open(char *path) {
} }
void sfx_music_play(uint32_t index) { void sfx_music_play(uint32_t index) {
error_if(index > len(def.music), "Invalid music index"); error_if(index >= len(def.music), "Invalid music index");
if (index == music->track_index) { if (index == music->track_index) {
sfx_music_rewind();
return; return;
} }