mirror of
https://github.com/DrBeef/Raze.git
synced 2025-03-24 10:01:57 +00:00
- fixed music lookup for user maps.
This was only looking for real files, but instead needs to check the file system. The game directory's content will always be part of that so other checks are counterproductive.
This commit is contained in:
parent
99b069d122
commit
7204b7c616
2 changed files with 18 additions and 6 deletions
|
@ -1668,3 +1668,20 @@ FResourceLump* FileSystem::GetFileAt(int no)
|
|||
return FileInfo[no].lump;
|
||||
}
|
||||
|
||||
#include "c_dispatch.h"
|
||||
|
||||
CCMD(fs_dir)
|
||||
{
|
||||
int numfiles = fileSystem.GetNumEntries();
|
||||
|
||||
for (int i = 0; i < numfiles; i++)
|
||||
{
|
||||
auto container = fileSystem.GetResourceFileFullName(fileSystem.GetFileContainer(i));
|
||||
auto fn1 = fileSystem.GetFileFullName(i);
|
||||
auto fns = fileSystem.GetFileShortName(i);
|
||||
auto fnid = fileSystem.GetResourceId(i);
|
||||
auto length = fileSystem.FileLength(i);
|
||||
bool hidden = fileSystem.FindFile(fn1) != i;
|
||||
Printf(PRINT_NONOTIFY, "%s%-64s %-15s (%5d) %10d %s %s\n", hidden? TEXTCOLOR_RED : TEXTCOLOR_UNTRANSLATED, fn1, fns, fnid, length, container, hidden ? "(h)" : "");
|
||||
}
|
||||
}
|
|
@ -75,15 +75,10 @@ FString G_SetupFilenameBasedMusic(const char* fn, const char* defmusic)
|
|||
FString name = StripExtension(fn);
|
||||
FString test;
|
||||
|
||||
// Test if a real file with this name exists with all known extensions for music.
|
||||
for (auto& ext : knownMusicExts)
|
||||
{
|
||||
test.Format("%s.%s", name.GetChars(), ext);
|
||||
if (FileExists(test)) return test;
|
||||
#ifdef __unix__
|
||||
test.Format("%s.%s", name.GetChars(), FString(ext).MakeLower().GetChars());
|
||||
if (FileExists(test)) return test;
|
||||
#endif
|
||||
if (fileSystem.FileExists(test)) return test;
|
||||
}
|
||||
return defmusic;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue