fix: load instances no matter their instance type

This commit is contained in:
Sefa Eyeoglu 2022-02-25 23:23:08 +01:00
parent 27f37315f8
commit c9bf7f9896
No known key found for this signature in database
GPG Key ID: C10411294912A422

View File

@ -543,19 +543,8 @@ InstancePtr InstanceList::loadInstance(const InstanceId& id)
auto instanceRoot = FS::PathCombine(m_instDir, id);
auto instanceSettings = std::make_shared<INISettingsObject>(FS::PathCombine(instanceRoot, "instance.cfg"));
InstancePtr inst;
instanceSettings->registerSetting("InstanceType", "Legacy"); // intentionally Legacy. We don't support it.
QString inst_type = instanceSettings->get("InstanceType").toString();
if (inst_type == "OneSix" || inst_type == "Nostalgia")
{
inst.reset(new MinecraftInstance(m_globalSettings, instanceSettings, instanceRoot));
}
else
{
inst.reset(new NullInstance(m_globalSettings, instanceSettings, instanceRoot));
}
// TODO: Handle incompatible instances
inst.reset(new MinecraftInstance(m_globalSettings, instanceSettings, instanceRoot));
qDebug() << "Loaded instance " << inst->name() << " from " << inst->instanceRoot();
return inst;
}