mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-31 22:05:10 +02:00
Merge pull request #2496 from IvanSavenko/saves_in_mods
Allowed loading saves from inside mods
This commit is contained in:
commit
8cbc52364a
@ -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);
|
||||||
|
@ -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());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2944,7 +2944,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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user