- fixed extended music lookup again.

This commit is contained in:
Christoph Oelckers 2021-04-09 21:21:53 +02:00
parent 92697686cb
commit 2084c53538
2 changed files with 15 additions and 11 deletions

View file

@ -243,3 +243,4 @@ void parseDefineTint(FScanner& sc, FScriptPosition& pos)
if (!sc.GetNumber(f)) return; if (!sc.GetNumber(f)) return;
lookups.setPaletteTint(pal, r, g, b, 0, 0, 0, f); lookups.setPaletteTint(pal, r, g, b, 0, 0, 0, f);
} }

View file

@ -133,7 +133,9 @@ FileReader OpenMusic(const char* musicname)
if (!reader.isOpen()) if (!reader.isOpen())
{ {
int lumpnum = LookupMusic(musicname); int lumpnum = LookupMusic(musicname);
if (mus_extendedlookup && lumpnum >= 0) if (mus_extendedlookup || lumpnum < 0)
{
if (lumpnum >= 0)
{ {
// EDuke also looks in a subfolder named after the main game resource. Do this as well if extended lookup is active. // 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 rfn = fileSystem.GetResourceFileName(fileSystem.GetFileContainer(lumpnum));
@ -142,12 +144,13 @@ FileReader OpenMusic(const char* musicname)
int newlumpnum = LookupMusic(aliasMusicname); int newlumpnum = LookupMusic(aliasMusicname);
if (newlumpnum >= 0) lumpnum = newlumpnum; if (newlumpnum >= 0) lumpnum = newlumpnum;
} }
if (lumpnum == -1)
{
// Always look in the 'music' subfolder as well. This gets used by multiple setups to store ripped CD tracks. // Always look in the 'music' subfolder as well. This gets used by multiple setups to store ripped CD tracks.
FStringf aliasMusicname("music/%s", musicname); FStringf aliasMusicname("music/%s", musicname);
lumpnum = LookupMusic(aliasMusicname); int newlumpnum = LookupMusic(aliasMusicname, lumpnum >= 0);
if (newlumpnum >= 0) lumpnum = newlumpnum;
} }
if (lumpnum == -1 && (g_gameType & GAMEFLAG_SW)) if (lumpnum == -1 && (g_gameType & GAMEFLAG_SW))
{ {
// Some Shadow Warrior 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.