NOISSUE Delete files from configs if they conflict with a mod

This commit is contained in:
Jamie Mansfield 2022-05-23 21:37:09 +01:00
parent c88f147ae4
commit 0327a3cdbf
No known key found for this signature in database
GPG Key ID: 36F61598F39F67B0

View File

@ -727,6 +727,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;