diff --git a/launcher/modManager/chroniclesextractor.cpp b/launcher/modManager/chroniclesextractor.cpp index bb4263d52..7f4702689 100644 --- a/launcher/modManager/chroniclesextractor.cpp +++ b/launcher/modManager/chroniclesextractor.cpp @@ -190,13 +190,14 @@ void ChroniclesExtractor::extractFiles(int no) QDir tmpDir = tempDir.filePath(tempDir.entryList({"app"}, QDir::Filter::Dirs).front()); tmpDir.setPath(tmpDir.filePath(tmpDir.entryList({QString(tmpChronicles)}, QDir::Filter::Dirs).front())); tmpDir.setPath(tmpDir.filePath(tmpDir.entryList({"data"}, QDir::Filter::Dirs).front())); - QDir outDirData(pathToQString(VCMIDirs::get().userDataPath() / "Mods" / "chronicles" / "Mods" / ("chronicles_" + std::to_string(no)) / "content" / "Data")); - QDir outDirSprites(pathToQString(VCMIDirs::get().userDataPath() / "Mods" / "chronicles" / "Mods" / ("chronicles_" + std::to_string(no)) / "content" / "Sprites")); - QDir outDirVideo(pathToQString(VCMIDirs::get().userDataPath() / "Mods" / "chronicles" / "Mods" / ("chronicles_" + std::to_string(no)) / "content" / "Video")); - QDir outDirSounds(pathToQString(VCMIDirs::get().userDataPath() / "Mods" / "chronicles" / "Mods" / ("chronicles_" + std::to_string(no)) / "content" / "Sounds")); - QDir outDirMaps(pathToQString(VCMIDirs::get().userDataPath() / "Mods" / "chronicles" / "Mods" / ("chronicles_" + std::to_string(no)) / "content" / "Maps")); + auto basePath = VCMIDirs::get().userDataPath() / "Mods" / "chronicles" / "Mods" / ("chronicles_" + std::to_string(no)) / "content"; + QDir outDirData(pathToQString(basePath / "Data")); + QDir outDirSprites(pathToQString(basePath / "Sprites")); + QDir outDirVideo(pathToQString(basePath / "Video")); + QDir outDirSounds(pathToQString(basePath / "Sounds")); + QDir outDirMaps(pathToQString(basePath / "Maps")); - auto extract = [no](QDir scrDir, QDir dest, QString file, std::vector files = {}){ + auto extract = [](QDir scrDir, QDir dest, QString file, std::vector files = {}){ CArchiveLoader archive("", scrDir.filePath(scrDir.entryList({file}).front()).toStdString(), false); for(auto & entry : archive.getEntries()) if(files.empty()) @@ -269,4 +270,4 @@ void ChroniclesExtractor::installChronicles(QStringList exe) handleTempDir(false); } -} \ No newline at end of file +} diff --git a/launcher/modManager/chroniclesextractor.h b/launcher/modManager/chroniclesextractor.h index 4defb200e..ba35a47bc 100644 --- a/launcher/modManager/chroniclesextractor.h +++ b/launcher/modManager/chroniclesextractor.h @@ -43,4 +43,4 @@ public: void installChronicles(QStringList exe); ChroniclesExtractor(QWidget *p, std::function cb = nullptr); -}; \ No newline at end of file +};