diff options
Diffstat (limited to 'logic/OneSixInstance.cpp')
-rw-r--r-- | logic/OneSixInstance.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/logic/OneSixInstance.cpp b/logic/OneSixInstance.cpp index 0e0be4d8..f6fe49f1 100644 --- a/logic/OneSixInstance.cpp +++ b/logic/OneSixInstance.cpp @@ -27,6 +27,7 @@ #include "icons/IconList.h" #include "MinecraftProcess.h" #include "gui/dialogs/OneSixModEditDialog.h" +#include <MMCError.h> OneSixInstance::OneSixInstance(const QString &rootDir, SettingsObject *settings, QObject *parent) : BaseInstance(new OneSixInstancePrivate(), rootDir, settings, parent) @@ -320,21 +321,23 @@ bool OneSixInstance::reloadVersion() { I_D(OneSixInstance); - bool ret = d->version->reload(false, externalPatches()); - if (ret) - { - ret = d->vanillaVersion->reload(true, externalPatches()); - } - if (ret) + try { + d->version->reload(false, externalPatches()); + d->vanillaVersion->reload(true, externalPatches()); setFlags(flags() & ~VersionBrokenFlag); emit versionReloaded(); + return true; } - else + catch(MMCError error) { + d->version->clear(); + d->vanillaVersion->clear(); setFlags(flags() | VersionBrokenFlag); + //TODO: rethrow to show some error message(s)? + emit versionReloaded(); + return false; } - return ret; } void OneSixInstance::clearVersion() |