Skip to content

Commit

Permalink
Fixed adding a disabled duplicate
Browse files Browse the repository at this point in the history
  • Loading branch information
enncoded committed Jun 14, 2019
1 parent 53ad5cb commit 0c5d121
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/logic/minecraft/SimpleModList.cpp
Expand Up @@ -123,8 +123,8 @@ bool SimpleModList::installMod(const QString &filename)
qDebug() << "Cannot recognize mod type of" << originalPath << ", ignoring it.";
return false;
}
auto newpath = FS::NormalizePath(FS::PathCombine(m_dir.path(), fileinfo.fileName()));

auto newpath = FS::NormalizePath(FS::PathCombine(m_dir.path(), fileinfo.fileName()));
if(originalPath == newpath)
{
qDebug() << "Overwriting the mod (" << originalPath << ") with itself makes no sense...";
Expand All @@ -133,7 +133,7 @@ bool SimpleModList::installMod(const QString &filename)

if (type == Mod::MOD_SINGLEFILE || type == Mod::MOD_ZIPFILE || type == Mod::MOD_LITEMOD)
{
if(QFile::exists(newpath))
if(QFile::exists(newpath) || QFile::exists(newpath.append(".disabled")))
{
if(!QFile::remove(newpath))
{
Expand Down

0 comments on commit 0c5d121

Please sign in to comment.