Merge pull request #201 from Scrumplex/fix-instancetype-reregistration
This commit is contained in:
commit
88fc1e32ee
@ -543,19 +543,8 @@ InstancePtr InstanceList::loadInstance(const InstanceId& id)
|
|||||||
auto instanceRoot = FS::PathCombine(m_instDir, id);
|
auto instanceRoot = FS::PathCombine(m_instDir, id);
|
||||||
auto instanceSettings = std::make_shared<INISettingsObject>(FS::PathCombine(instanceRoot, "instance.cfg"));
|
auto instanceSettings = std::make_shared<INISettingsObject>(FS::PathCombine(instanceRoot, "instance.cfg"));
|
||||||
InstancePtr inst;
|
InstancePtr inst;
|
||||||
|
// TODO: Handle incompatible instances
|
||||||
instanceSettings->registerSetting("InstanceType", "Legacy"); // intentionally Legacy. We don't support it.
|
inst.reset(new MinecraftInstance(m_globalSettings, instanceSettings, instanceRoot));
|
||||||
|
|
||||||
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));
|
|
||||||
}
|
|
||||||
qDebug() << "Loaded instance " << inst->name() << " from " << inst->instanceRoot();
|
qDebug() << "Loaded instance " << inst->name() << " from " << inst->instanceRoot();
|
||||||
return inst;
|
return inst;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user