summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api/logic/minecraft/ComponentList.cpp11
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
{