1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

- fixed 1247

This commit is contained in:
Ivan Savenko 2013-03-23 16:19:27 +00:00
parent e936700438
commit 8f998b009b
2 changed files with 2 additions and 2 deletions

View File

@ -57,6 +57,7 @@ SettingsStorage::SettingsStorage():
void SettingsStorage::init()
{
CResourceHandler::get()->createResource("config/settings.json");
JsonNode(ResourceID("config/settings.json")).swap(config);
JsonNode schema(ResourceID("config/defaultSettings.json"));
JsonUtils::validate(config, schema);
@ -73,8 +74,6 @@ void SettingsStorage::invalidateNode(const std::vector<std::string> &changedPath
savedConf.Struct().erase("session");
JsonUtils::minimize(savedConf, schema);
CResourceHandler::get()->createResource("CONFIG/settings.json");
std::ofstream file(CResourceHandler::get()->getResourceName(ResourceID("config/settings.json")), std::ofstream::trunc);
file << savedConf;
}

View File

@ -46,6 +46,7 @@ bool CFilesystemLoader::createEntry(std::string filename)
return false;
fileList[res] = filename;
std::ofstream newfile (baseDirectory + "/" + filename);
return true;
}