diff options
author | Petr Mrázek <peterix@gmail.com> | 2018-02-09 00:54:17 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2018-02-09 00:54:17 +0100 |
commit | b3fb437f8eea77b1b6210d22aa247138eb14dac6 (patch) | |
tree | 9f40971d2479a7f7c515e31b7d9aede11d1e94ef /api/logic/minecraft/ComponentList.cpp | |
parent | f115bdf5b89b2d3890102ad6b8acc3ba659ebe2b (diff) | |
download | MultiMC-b3fb437f8eea77b1b6210d22aa247138eb14dac6.tar MultiMC-b3fb437f8eea77b1b6210d22aa247138eb14dac6.tar.gz MultiMC-b3fb437f8eea77b1b6210d22aa247138eb14dac6.tar.lz MultiMC-b3fb437f8eea77b1b6210d22aa247138eb14dac6.tar.xz MultiMC-b3fb437f8eea77b1b6210d22aa247138eb14dac6.zip |
NOISSUE When changing version of or installing a package, remove customized version
Diffstat (limited to 'api/logic/minecraft/ComponentList.cpp')
-rw-r--r-- | api/logic/minecraft/ComponentList.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/api/logic/minecraft/ComponentList.cpp b/api/logic/minecraft/ComponentList.cpp index dc7f3614..43ab3de8 100644 --- a/api/logic/minecraft/ComponentList.cpp +++ b/api/logic/minecraft/ComponentList.cpp @@ -1172,10 +1172,15 @@ bool ComponentList::setComponentVersion(const QString& uid, const QString& versi auto iter = d->componentIndex.find(uid); if(iter != d->componentIndex.end()) { + ComponentPtr component = *iter; // set existing - (*iter)->setVersion(version); - (*iter)->setImportant(important); - return true; + if(component->revert()) + { + component->setVersion(version); + component->setImportant(important); + return true; + } + return false; } else { |