List which level subdirectory a mod changes
parent
e6ce4112c6
commit
253cca379b
|
@ -281,6 +281,17 @@ void CModManager::LoadModData(Mod& mod)
|
|||
|
||||
// Changes
|
||||
data.changes = CResourceManager::ListDirectories("temp/mod");
|
||||
auto levelsIt = std::find(data.changes.begin(), data.changes.end(), "levels");
|
||||
if (levelsIt != data.changes.end())
|
||||
{
|
||||
auto levelsDirs = CResourceManager::ListDirectories("temp/mod/levels");
|
||||
if (!levelsDirs.empty())
|
||||
{
|
||||
std::transform(levelsDirs.begin(), levelsDirs.end(), levelsDirs.begin(), [](const std::string& dir) { return "levels/" + dir; });
|
||||
levelsIt = data.changes.erase(levelsIt);
|
||||
data.changes.insert(levelsIt, levelsDirs.begin(), levelsDirs.end());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CModManager::MountMod(const Mod& mod, const std::string& mountPoint)
|
||||
|
|
Loading…
Reference in New Issue