Skip to content

Commit

Permalink
Avoid returning 'assets.lst' from forEachFile()
Browse files Browse the repository at this point in the history
The assets.lst is intended to be converted into vfs::Visibility values by the
VFS module, not returned directly as a file.
  • Loading branch information
Matthew Mott committed Mar 5, 2019
1 parent 6a9561b commit 77afaa5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions radiant/test/vfsTest.cpp
Expand Up @@ -70,4 +70,8 @@ BOOST_FIXTURE_TEST_CASE(handleAssetsLst, VFSFixture)
BOOST_TEST(fileVis.count("darkmod/test/unit_cube.ase") == 1);
BOOST_TEST(fileVis["darkmod/test/unit_cube.ase"] == vfs::Visibility::HIDDEN);
BOOST_TEST(fileVis["darkmod/test/unit_cube.lwo"] == vfs::Visibility::NORMAL);

// The assets.lst should be converted into visibility information, but NOT
// returned as an actual file to the calling code.
BOOST_TEST(fileVis.count("assets.lst") == 0);
}
4 changes: 4 additions & 0 deletions radiant/vfs/Doom3FileSystem.cpp
Expand Up @@ -211,6 +211,10 @@ class FileVisitor: public Archive::Visitor
return; // already visited
}

// Don't return assets.lst itself
if (subname == AssetsList::FILENAME)
return;

// Suitable file, call the callback and add to visited file set
vfs::Visibility vis = _assetsList ? _assetsList->getVisibility(subname)
: Visibility::NORMAL;
Expand Down

0 comments on commit 77afaa5

Please sign in to comment.