Fix voice playback issue in Daibanchou

This fixes an issue where wav_unload_slot() stops playing ALL channels
if slot->channel == -1.
This commit is contained in:
kichikuou
2021-02-23 18:32:58 +09:00
parent bd4d0c27b5
commit da11820bd5
+2 -1
View File
@@ -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);