diff options
author | janrupf <werbung.janrupf@t-online.de> | 2018-11-08 18:14:20 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2018-11-12 01:49:35 +0100 |
commit | 16df8d7b883f10239a961997ba8ff123100ebfae (patch) | |
tree | 29ed9cfb381618161c1658fcf6d9ab5994ea580e /api/logic | |
parent | 3d630c7856ce73ab2f26a80d3fc4f2c69f3440b0 (diff) | |
download | MultiMC-16df8d7b883f10239a961997ba8ff123100ebfae.tar MultiMC-16df8d7b883f10239a961997ba8ff123100ebfae.tar.gz MultiMC-16df8d7b883f10239a961997ba8ff123100ebfae.tar.lz MultiMC-16df8d7b883f10239a961997ba8ff123100ebfae.tar.xz MultiMC-16df8d7b883f10239a961997ba8ff123100ebfae.zip |
GH-2384 Replace existing mod files
Diffstat (limited to 'api/logic')
-rw-r--r-- | api/logic/minecraft/SimpleModList.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/api/logic/minecraft/SimpleModList.cpp b/api/logic/minecraft/SimpleModList.cpp index a9fb42eb..e8583a35 100644 --- a/api/logic/minecraft/SimpleModList.cpp +++ b/api/logic/minecraft/SimpleModList.cpp @@ -146,6 +146,8 @@ bool SimpleModList::installMod(const QString &filename) if (type == Mod::MOD_SINGLEFILE || type == Mod::MOD_ZIPFILE || type == Mod::MOD_LITEMOD) { QString newpath = FS::PathCombine(m_dir.path(), fileinfo.fileName()); + if(QFile::exists(newpath)) + QFile::remove(newpath); if (!QFile::copy(fileinfo.filePath(), newpath)) return false; FS::updateTimestamp(newpath); |