aboutsummaryrefslogtreecommitdiff
path: root/launcher/modplatform/modrinth
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/modplatform/modrinth')
-rw-r--r--launcher/modplatform/modrinth/ModrinthInstanceCreationTask.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/launcher/modplatform/modrinth/ModrinthInstanceCreationTask.cpp b/launcher/modplatform/modrinth/ModrinthInstanceCreationTask.cpp
index c1898dd9..2cb6e786 100644
--- a/launcher/modplatform/modrinth/ModrinthInstanceCreationTask.cpp
+++ b/launcher/modplatform/modrinth/ModrinthInstanceCreationTask.cpp
@@ -262,12 +262,20 @@ bool ModrinthCreationTask::createInstance()
loop.exec();
+ // Update information of the already installed instance, if any.
if (m_instance && ended_well) {
setAbortable(false);
auto inst = m_instance.value();
+ // Only change the name if it didn't use a custom name, so that the previous custom name
+ // is preserved, but if we're using the original one, we update the version string.
+ // NOTE: This needs to come before the copyManagedPack call!
+ if (inst->name().contains(inst->getManagedPackVersionName())) {
+ if (askForChangingInstanceName(m_parent, inst->name(), instance.name()) == InstanceNameChange::ShouldChange)
+ inst->setName(instance.name());
+ }
+
inst->copyManagedPack(instance);
- inst->setName(instance.name());
}
return ended_well;