1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

CodeReview

This commit is contained in:
Laserlicht
2023-09-21 23:41:00 +02:00
committed by GitHub
parent 530e4533ce
commit 9e78f9c69c
2 changed files with 5 additions and 10 deletions

View File

@@ -689,18 +689,13 @@ void CServerHandler::startCampaignScenario(std::shared_ptr<CampaignState> cs)
entry->Bool() = true; entry->Bool() = true;
} }
GH.windows().pushWindow(CMM);
GH.windows().pushWindow(CMM->menu);
if(!ourCampaign->isCampaignFinished()) if(!ourCampaign->isCampaignFinished())
{
GH.windows().pushWindow(CMM);
GH.windows().pushWindow(CMM->menu);
CMM->openCampaignLobby(ourCampaign); CMM->openCampaignLobby(ourCampaign);
}
else else
{
GH.windows().pushWindow(CMM);
GH.windows().pushWindow(CMM->menu);
CMM->openCampaignScreen(ourCampaign->campaignSet); CMM->openCampaignScreen(ourCampaign->campaignSet);
}
}; };
if(epilogue.hasPrologEpilog) if(epilogue.hasPrologEpilog)
{ {

View File

@@ -67,7 +67,7 @@ void SettingsStorage::init(const std::string & dataFilename, const std::string &
if (!CResourceHandler::get("local")->existsResource(confName)) if (!CResourceHandler::get("local")->existsResource(confName))
CResourceHandler::get("local")->createResource(dataFilename); CResourceHandler::get("local")->createResource(dataFilename);
if(schema != "") if(!schema.empty())
{ {
JsonUtils::maximize(config, schema); JsonUtils::maximize(config, schema);
JsonUtils::validate(config, schema, "settings"); JsonUtils::validate(config, schema, "settings");
@@ -81,7 +81,7 @@ void SettingsStorage::invalidateNode(const std::vector<std::string> &changedPath
JsonNode savedConf = config; JsonNode savedConf = config;
savedConf.Struct().erase("session"); savedConf.Struct().erase("session");
if(schema != "") if(!schema.empty())
JsonUtils::minimize(savedConf, schema); JsonUtils::minimize(savedConf, schema);
std::fstream file(CResourceHandler::get()->getResourceName(JsonPath::builtin(dataFilename))->c_str(), std::ofstream::out | std::ofstream::trunc); std::fstream file(CResourceHandler::get()->getResourceName(JsonPath::builtin(dataFilename))->c_str(), std::ofstream::out | std::ofstream::trunc);