From 16df8d7b883f10239a961997ba8ff123100ebfae Mon Sep 17 00:00:00 2001 From: janrupf Date: Thu, 8 Nov 2018 18:14:20 +0100 Subject: GH-2384 Replace existing mod files --- api/logic/minecraft/SimpleModList.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'api') 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); -- cgit