From 791221e923586bb717396ecf18bd13e57034df99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Tue, 27 Jan 2015 22:31:07 +0100 Subject: NOISSUE Refactors and moving of things --- logic/InstanceList.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'logic/InstanceList.cpp') 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 &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(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(mcVersion); + auto error = factory.createInstance(instPtr, ftbVersion, record.instanceDir); if (!instPtr || error != InstanceFactory::NoCreateError) continue; -- cgit v1.2.3