From 793d2d99ef14329fe5313b4d8ccd22310cfe952b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 8 Apr 2021 17:46:53 +0200 Subject: [PATCH] - re-fixed the music lookup. --- source/core/raze_music.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/core/raze_music.cpp b/source/core/raze_music.cpp index 8586dbc00..b2c3f0aed 100644 --- a/source/core/raze_music.cpp +++ b/source/core/raze_music.cpp @@ -133,13 +133,14 @@ FileReader OpenMusic(const char* musicname) if (!reader.isOpen()) { int lumpnum = LookupMusic(musicname); - if (mus_extendedlookup && lumpnum < 0) + if (mus_extendedlookup && lumpnum >= 0) { // EDuke also looks in a subfolder named after the main game resource. Do this as well if extended lookup is active. auto rfn = fileSystem.GetResourceFileName(fileSystem.GetFileContainer(lumpnum)); auto rfbase = ExtractFileBase(rfn); FStringf aliasMusicname("music/%s/%s", rfbase.GetChars(), musicname); - lumpnum = LookupMusic(aliasMusicname); + int newlumpnum = LookupMusic(aliasMusicname); + if (newlumpnum >= 0) lumpnum = newlumpnum; } if (lumpnum == -1) { @@ -149,7 +150,7 @@ FileReader OpenMusic(const char* musicname) } if (lumpnum == -1 && (g_gameType & GAMEFLAG_SW)) { - // Some Shadow Warrioe distributions have the music in a subfolder named 'classic'. Check that, too. + // Some Shadow Warrior distributions have the music in a subfolder named 'classic'. Check that, too. FStringf aliasMusicname("classic/music/%s", musicname); lumpnum = fileSystem.FindFile(aliasMusicname); }