1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-28 15:38:30 +02:00

Ignore directories when loading level metadata

Otherwise, this would produce a superfluous warning message in the
console. Directories are now ignored and never attempted to be opened;
so now any warning messages printed out are genuine file that something
has genuinely gone wrong with.

Well, there's still a warning message printed if there's a symlink to a
directory; this is rarer, but it's still a false positive.
This commit is contained in:
Misa 2021-03-04 16:42:02 -08:00 committed by Ethan Lee
parent 838ffbe68f
commit 6efed0740b

View File

@ -79,6 +79,11 @@ static bool compare_nocase (std::string first, std::string second)
static void levelZipCallback(const char* filename)
{
if (!FILESYSTEM_isFile(filename))
{
return;
}
if (endsWith(filename, ".zip"))
{
FILESYSTEM_loadZip(filename);
@ -201,6 +206,11 @@ static void levelMetaDataCallback(const char* filename)
LevelMetaData temp;
std::string filename_ = filename;
if (!FILESYSTEM_isFile(filename))
{
return;
}
if (ed.getLevelMetaData(filename_, temp))
{
ed.ListOfMetaData.push_back(temp);