From da11820bd5ea6f9158a3cbeecc5d0cf667862409 Mon Sep 17 00:00:00 2001 From: kichikuou Date: Tue, 23 Feb 2021 18:32:58 +0900 Subject: [PATCH] Fix voice playback issue in Daibanchou This fixes an issue where wav_unload_slot() stops playing ALL channels if slot->channel == -1. --- src/audio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/audio.c b/src/audio.c index 3f1ac2c..fd936bb 100644 --- a/src/audio.c +++ b/src/audio.c @@ -264,7 +264,8 @@ static bool bgm_load_music(int no, struct bgm_slot *slot) static void wav_unload_slot(struct wav_slot *slot) { if (slot->chunk) { - Mix_HaltChannel(slot->channel); + if (slot->channel >= 0) + Mix_HaltChannel(slot->channel); Mix_FreeChunk(slot->chunk); slot->chunk = NULL; archive_free_data(slot->dfile);