diff --git a/src/organizercore.cpp b/src/organizercore.cpp index 3a959cb38..f75a8717d 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -1984,8 +1984,12 @@ std::vector OrganizerCore::fileMapping(const QString &profileName, MappingType result; - QString dataPath - = QDir::toNativeSeparators(game->dataDirectory().absolutePath()); + QStringList dataPaths; + dataPaths.append(QDir::toNativeSeparators(game->dataDirectory().absolutePath())); + + for (auto directory : game->secondaryDataDirectories()) { + dataPaths.append(directory.absolutePath()); + } bool overwriteActive = false; @@ -2002,8 +2006,10 @@ std::vector OrganizerCore::fileMapping(const QString &profileName, overwriteActive |= createTarget; if (modPtr->isRegular()) { - result.insert(result.end(), {QDir::toNativeSeparators(std::get<1>(mod)), - dataPath, true, createTarget}); + for (auto dataPath : dataPaths) { + result.insert(result.end(), { QDir::toNativeSeparators(std::get<1>(mod)), + dataPath, true, createTarget }); + } } } @@ -2024,12 +2030,14 @@ std::vector OrganizerCore::fileMapping(const QString &profileName, } } - result.insert(result.end(), { - QDir::toNativeSeparators(m_Settings.paths().overwrite()), - dataPath, - true, - customOverwrite.isEmpty() - }); + for (auto dataPath : dataPaths) { + result.insert(result.end(), { + QDir::toNativeSeparators(m_Settings.paths().overwrite()), + dataPath, + true, + customOverwrite.isEmpty() + }); + } for (MOBase::IPluginFileMapper *mapper : m_PluginContainer->plugins()) {