Fix FTB-related issues

This commit is contained in:
Petr Mrázek
2014-03-31 00:19:43 +02:00
parent a3c95d9bcc
commit 29b00eab31
8 changed files with 80 additions and 3 deletions

View File

@@ -174,6 +174,15 @@ InstanceFactory::InstCreateError InstanceFactory::copyInstance(InstancePtr &newI
return InstanceFactory::CantCreateDir;
}
INISettingsObject settings_obj(PathCombine(instDir, "instance.cfg"));
settings_obj.registerSetting("InstanceType", "Legacy");
QString inst_type = settings_obj.get("InstanceType").toString();
if (inst_type == "OneSixFTB")
settings_obj.set("InstanceType", "OneSix");
if (inst_type == "LegacyFTB")
settings_obj.set("InstanceType", "Legacy");
oldInstance->copy(instDir);
auto error = loadInstance(newInstance, instDir);
@@ -190,5 +199,4 @@ InstanceFactory::InstCreateError InstanceFactory::copyInstance(InstancePtr &newI
rootDir.removeRecursively();
return UnknownCreateError;
}
return UnknownCreateError;
}