1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-09-16 09:26:28 +02:00

Fix campaign serialization

This commit is contained in:
nordsoft
2022-10-03 01:48:03 +04:00
parent 3621b05682
commit 628abd1428
3 changed files with 9 additions and 5 deletions

View File

@@ -200,6 +200,8 @@ void CClient::newGame(CGameState * initializedGameState)
void CClient::loadGame(CGameState * initializedGameState)
{
logNetwork->info("Loading procedure started!");
std::unique_ptr<CLoadFile> loader;
if(initializedGameState)
{
@@ -208,7 +210,6 @@ void CClient::loadGame(CGameState * initializedGameState)
}
else
{
std::unique_ptr<CLoadFile> loader;
try
{
boost::filesystem::path clientSaveName = *CResourceHandler::get("local")->getResourceName(ResourceID(CSH->si->mapname, EResType::CLIENT_SAVEGAME));
@@ -234,8 +235,6 @@ void CClient::loadGame(CGameState * initializedGameState)
loadCommonState(checkingLoader);
loader = checkingLoader.decay();
}
serialize(loader->serializer, loader->serializer.fileVersion);
}
catch(std::exception & e)
{
@@ -253,6 +252,9 @@ void CClient::loadGame(CGameState * initializedGameState)
reinitScripting();
initPlayerEnvironments();
if(loader)
serialize(loader->serializer, loader->serializer.fileVersion);
initPlayerInterfaces();
}