fixed bugs when using music sets without unconfigured game music
authorHolger Schemel <info@artsoft.org>
Thu, 8 Jun 2023 00:12:12 +0000 (02:12 +0200)
committerHolger Schemel <info@artsoft.org>
Thu, 8 Jun 2023 00:12:26 +0000 (02:12 +0200)
Without this fix, playing a level set with an "empty" music set (that
has no in-game music, like it is the case for all Emerald Mine Club
level sets, for example) caused the game to fall back to the classic
(default) game music set, even though using an "empty" music set was
by intention in such cases.

src/libgame/setup.c

index f9fb34eaeb50f636a67448cedb2ceed10ee47e2e..6886e101d343e5e63d14bcb640f70d7806019be2 100644 (file)
@@ -1326,7 +1326,9 @@ static char *getCustomMusicDirectoryExt(boolean check_music)
     {
       // 2nd try: look for special artwork configured in level series config
       directory = getStringCopy(getLevelArtworkDir(TREE_TYPE_MUSIC_DIR));
-      if (directoryExists_CheckMusic(directory, check_music))
+
+      // directory also valid if no unconfigured music found (no game music)
+      if (directoryExists_CheckMusic(directory, FALSE))
        return directory;
 
       free(directory);
@@ -1340,7 +1342,9 @@ static char *getCustomMusicDirectoryExt(boolean check_music)
   {
     // 3rd try: look for special artwork in configured artwork directory
     directory = getStringCopy(getSetupArtworkDir(artwork.mus_current));
-    if (directoryExists_CheckMusic(directory, check_music))
+
+    // directory also valid if no unconfigured music found (no game music)
+    if (directoryExists_CheckMusic(directory, FALSE))
       return directory;
 
     free(directory);