Laserlicht %!s(int64=2) %!d(string=hai) anos
pai
achega
9e78f9c69c
Modificáronse 2 ficheiros con 5 adicións e 10 borrados
  1. 3 8
      client/CServerHandler.cpp
  2. 2 2
      lib/CConfigHandler.cpp

+ 3 - 8
client/CServerHandler.cpp

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

+ 2 - 2
lib/CConfigHandler.cpp

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