mirror of
https://github.com/MultiMC/MultiMC5.git
synced 2024-12-27 03:14:49 +00:00
NOISSUE Delete files from configs if they conflict with a mod
This commit is contained in:
parent
c88f147ae4
commit
0327a3cdbf
@ -727,6 +727,17 @@ bool PackInstallTask::extractMods(
|
|||||||
for (auto iter = toCopy.begin(); iter != toCopy.end(); iter++) {
|
for (auto iter = toCopy.begin(); iter != toCopy.end(); iter++) {
|
||||||
auto &from = iter.key();
|
auto &from = iter.key();
|
||||||
auto &to = iter.value();
|
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);
|
FS::copy fileCopyOperation(from, to);
|
||||||
if(!fileCopyOperation()) {
|
if(!fileCopyOperation()) {
|
||||||
qWarning() << "Failed to copy" << from << "to" << to;
|
qWarning() << "Failed to copy" << from << "to" << to;
|
||||||
|
Loading…
Reference in New Issue
Block a user