From b484e85e7e40144b31eb329965dd603b0c931889 Mon Sep 17 00:00:00 2001 From: Dominic Szablewski Date: Sun, 13 Aug 2023 22:12:29 +0200 Subject: [PATCH] Fix music decoder playing garbage; close #8 --- src/wipeout/sfx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wipeout/sfx.c b/src/wipeout/sfx.c index a2506c9..2213603 100644 --- a/src/wipeout/sfx.c +++ b/src/wipeout/sfx.c @@ -285,8 +285,9 @@ void sfx_music_open(char *path) { } 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) { + sfx_music_rewind(); return; }