@@ -97,16 +97,19 @@ void Resources::loadVdfs(const std::vector<std::u16string>& modvdfs) {
9797 inst->detectVdf (archives,Gothic::inst ().nestedPath ({u" Data" },Dir::FT_Dir));
9898
9999 // Remove all mod files, that are not listed in modvdfs
100- archives.erase (std::remove_if (archives.begin (), archives.end (),
101- [&modvdfs](const Archive& a){
102- return a.isMod && modvdfs.end () == std::find_if (modvdfs.begin (), modvdfs.end (),
103- [&a](const std::u16string& modname) {
104- const std::u16string_view& full_path = a.name ;
105- const std::u16string_view& file_name = modname;
106- return (0 == full_path.compare (full_path.length () - file_name.length (),
107- file_name.length (), file_name));
108- });
109- }), archives.end ());
100+ if (!modvdfs.empty ()) {
101+ // NOTE: apparently in CoM there is no mods list declaration. In such case - assume all modes
102+ archives.erase (std::remove_if (archives.begin (), archives.end (),
103+ [&modvdfs](const Archive& a){
104+ return a.isMod && modvdfs.end () == std::find_if (modvdfs.begin (), modvdfs.end (),
105+ [&a](const std::u16string& modname) {
106+ const std::u16string_view& full_path = a.name ;
107+ const std::u16string_view& file_name = modname;
108+ return (0 == full_path.compare (full_path.length () - file_name.length (),
109+ file_name.length (), file_name));
110+ });
111+ }), archives.end ());
112+ }
110113
111114 // addon archives first!
112115 std::stable_sort (archives.begin (),archives.end (),[](const Archive& a,const Archive& b){
0 commit comments