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

Allowed loading saves from inside mods

This commit is contained in:
Ivan Savenko 2023-08-06 19:39:55 +03:00
parent b9e804954d
commit 9bd27c50a0
3 changed files with 3 additions and 3 deletions

View File

@ -219,7 +219,7 @@ void CClient::loadGame(CGameState * initializedGameState)
// try to deserialize client data including sleepingHeroes
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())
throw std::runtime_error("Cannot open client part of " + CSH->si->mapname);

View File

@ -426,7 +426,7 @@ void SelectionTab::select(int position)
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());
}

View File

@ -2942,7 +2942,7 @@ bool CGameHandler::load(const std::string & filename)
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);
logGlobal->info("Loading server state");
lf >> *this;