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:
parent
b9e804954d
commit
9bd27c50a0
@ -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);
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user