aboutsummaryrefslogtreecommitdiff
path: root/launcher/modplatform/atlauncher
diff options
context:
space:
mode:
authorJamie Mansfield <jmansfield@cadixdev.org>2022-05-23 21:37:09 +0100
committerJamie Mansfield <jmansfield@cadixdev.org>2022-05-23 21:44:01 +0100
commit4ee5264e24e21d89185d424072dc39cb6b2dd10f (patch)
tree423ca205ea81aee7e7dc49ad85bb04bfe119c37f /launcher/modplatform/atlauncher
parent101ca60b2bb1d3c3047bc5842461c68d05708e39 (diff)
downloadPrismLauncher-4ee5264e24e21d89185d424072dc39cb6b2dd10f.tar.gz
PrismLauncher-4ee5264e24e21d89185d424072dc39cb6b2dd10f.tar.bz2
PrismLauncher-4ee5264e24e21d89185d424072dc39cb6b2dd10f.zip
ATLauncher: Delete files from configs if they conflict with a mod
Diffstat (limited to 'launcher/modplatform/atlauncher')
-rw-r--r--launcher/modplatform/atlauncher/ATLPackInstallTask.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/launcher/modplatform/atlauncher/ATLPackInstallTask.cpp b/launcher/modplatform/atlauncher/ATLPackInstallTask.cpp
index b2dda4e4..62c7bf6d 100644
--- a/launcher/modplatform/atlauncher/ATLPackInstallTask.cpp
+++ b/launcher/modplatform/atlauncher/ATLPackInstallTask.cpp
@@ -781,6 +781,17 @@ bool PackInstallTask::extractMods(
for (auto iter = toCopy.begin(); iter != toCopy.end(); iter++) {
auto &from = iter.key();
auto &to = iter.value();
+
+ // If the file already exists, assume the mod is the correct copy - and remove
+ // the copy from the Configs.zip
+ QFileInfo fileInfo(to);
+ if (fileInfo.exists()) {
+ if (!QFile::remove(to)) {
+ qWarning() << "Failed to delete" << to;
+ return false;
+ }
+ }
+
FS::copy fileCopyOperation(from, to);
if(!fileCopyOperation()) {
qWarning() << "Failed to copy" << from << "to" << to;