From 96892ba2b867860075918ff367bb7bdb5ae644ed Mon Sep 17 00:00:00 2001 From: arthomnix Date: Tue, 16 Apr 2024 19:58:52 +0100 Subject: [PATCH] NOISSUE Fix configs sometimes not being included in exported mrpacks --- .../modrinth/ModrinthInstanceExportTask.cpp | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/launcher/modplatform/modrinth/ModrinthInstanceExportTask.cpp b/launcher/modplatform/modrinth/ModrinthInstanceExportTask.cpp index be57fbb7..3e4d9913 100644 --- a/launcher/modplatform/modrinth/ModrinthInstanceExportTask.cpp +++ b/launcher/modplatform/modrinth/ModrinthInstanceExportTask.cpp @@ -225,9 +225,10 @@ void InstanceExportTask::lookupSucceeded() if (tmp.isValid()) { Json::write(indexJson, tmp.path() + "/modrinth.index.json"); + QDir tmpDir(tmp.path()); + QDir gameDir(m_instance->gameRoot()); + if (!failedFiles.isEmpty()) { - QDir tmpDir(tmp.path()); - QDir gameDir(m_instance->gameRoot()); for (const auto &file : failedFiles) { QString src = file.absoluteFilePath(); tmpDir.mkpath("overrides/" + gameDir.relativeFilePath(file.absolutePath())); @@ -237,17 +238,17 @@ void InstanceExportTask::lookupSucceeded() return; } } + } - if (m_settings.includeGameConfig) { - tmpDir.mkdir("overrides"); - QFile::copy(gameDir.absoluteFilePath("options.txt"), tmpDir.absoluteFilePath("overrides/options.txt")); - } + if (m_settings.includeGameConfig) { + tmpDir.mkdir("overrides"); + QFile::copy(gameDir.absoluteFilePath("options.txt"), tmpDir.absoluteFilePath("overrides/options.txt")); + } - if (m_settings.includeModConfigs) { - tmpDir.mkdir("overrides"); - FS::copy copy(m_instance->gameRoot() + "/config", tmpDir.absoluteFilePath("overrides/config")); - copy(); - } + if (m_settings.includeModConfigs) { + tmpDir.mkdir("overrides"); + FS::copy copy(gameDir.absoluteFilePath("config"), tmpDir.absoluteFilePath("overrides/config")); + copy(); } setStatus(tr("Zipping modpack..."));