Bläddra i källkod

Allowed loading saves from inside mods

Ivan Savenko 2 år sedan
förälder
incheckning
9bd27c50a0
3 ändrade filer med 3 tillägg och 3 borttagningar
  1. 1 1
      client/Client.cpp
  2. 1 1
      client/lobby/SelectionTab.cpp
  3. 1 1
      server/CGameHandler.cpp

+ 1 - 1
client/Client.cpp

@@ -219,7 +219,7 @@ void CClient::loadGame(CGameState * initializedGameState)
 	// try to deserialize client data including sleepingHeroes
 	// try to deserialize client data including sleepingHeroes
 	try
 	try
 	{
 	{
-		boost::filesystem::path clientSaveName = *CResourceHandler::get("local")->getResourceName(ResourceID(CSH->si->mapname, EResType::CLIENT_SAVEGAME));
+		boost::filesystem::path clientSaveName = *CResourceHandler::get()->getResourceName(ResourceID(CSH->si->mapname, EResType::CLIENT_SAVEGAME));
 
 
 		if(clientSaveName.empty())
 		if(clientSaveName.empty())
 			throw std::runtime_error("Cannot open client part of " + CSH->si->mapname);
 			throw std::runtime_error("Cannot open client part of " + CSH->si->mapname);

+ 1 - 1
client/lobby/SelectionTab.cpp

@@ -426,7 +426,7 @@ void SelectionTab::select(int position)
 
 
 	if(inputName && inputName->isActive())
 	if(inputName && inputName->isActive())
 	{
 	{
-		auto filename = *CResourceHandler::get("local")->getResourceName(ResourceID(curItems[py]->fileURI, EResType::SAVEGAME));
+		auto filename = *CResourceHandler::get()->getResourceName(ResourceID(curItems[py]->fileURI, EResType::SAVEGAME));
 		inputName->setText(filename.stem().string());
 		inputName->setText(filename.stem().string());
 	}
 	}
 
 

+ 1 - 1
server/CGameHandler.cpp

@@ -2942,7 +2942,7 @@ bool CGameHandler::load(const std::string & filename)
 	try
 	try
 	{
 	{
 		{
 		{
-			CLoadFile lf(*CResourceHandler::get("local")->getResourceName(ResourceID(stem.to_string(), EResType::SAVEGAME)), MINIMAL_SERIALIZATION_VERSION);
+			CLoadFile lf(*CResourceHandler::get()->getResourceName(ResourceID(stem.to_string(), EResType::SAVEGAME)), MINIMAL_SERIALIZATION_VERSION);
 			loadCommonState(lf);
 			loadCommonState(lf);
 			logGlobal->info("Loading server state");
 			logGlobal->info("Loading server state");
 			lf >> *this;
 			lf >> *this;