diff options
author | Petr Mrázek <peterix@gmail.com> | 2015-01-27 22:31:07 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2015-04-02 00:14:06 +0200 |
commit | 791221e923586bb717396ecf18bd13e57034df99 (patch) | |
tree | 9f608af07375b38626c8964671620477158341ba /logic/InstanceList.cpp | |
parent | 593111b14463e9d5d08256061b981b5ab1cfb710 (diff) | |
download | MultiMC-791221e923586bb717396ecf18bd13e57034df99.tar MultiMC-791221e923586bb717396ecf18bd13e57034df99.tar.gz MultiMC-791221e923586bb717396ecf18bd13e57034df99.tar.lz MultiMC-791221e923586bb717396ecf18bd13e57034df99.tar.xz MultiMC-791221e923586bb717396ecf18bd13e57034df99.zip |
NOISSUE Refactors and moving of things
Diffstat (limited to 'logic/InstanceList.cpp')
-rw-r--r-- | logic/InstanceList.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/logic/InstanceList.cpp b/logic/InstanceList.cpp index 29908e01..ec7dbdbf 100644 --- a/logic/InstanceList.cpp +++ b/logic/InstanceList.cpp @@ -32,6 +32,7 @@ #include "logic/minecraft/MinecraftVersionList.h" #include "logic/BaseInstance.h" #include "logic/InstanceFactory.h" +#include "ftb/FTBVersion.h" #include "logger/QsLog.h" #include "gui/groupview/GroupView.h" @@ -403,16 +404,16 @@ void InstanceList::loadFTBInstances(QMap<QString, QString> &groupMap, QLOG_INFO() << "Converting " << record.name << " as new."; InstancePtr instPtr; auto &factory = InstanceFactory::get(); - auto version = MMC->minecraftlist()->findVersion(record.mcVersion); - if (!version) + auto mcVersion = std::dynamic_pointer_cast<MinecraftVersion>(MMC->minecraftlist()->findVersion(record.mcVersion)); + if (!mcVersion) { QLOG_ERROR() << "Can't load instance " << record.instanceDir << " because minecraft version " << record.mcVersion << " can't be resolved."; continue; } - auto error = factory.createInstance(instPtr, version, record.instanceDir, - InstanceFactory::FTBInstance); + auto ftbVersion = std::make_shared<FTBVersion>(mcVersion); + auto error = factory.createInstance(instPtr, ftbVersion, record.instanceDir); if (!instPtr || error != InstanceFactory::NoCreateError) continue; |