1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-19 21:10:12 +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();
}

View File

@ -57,7 +57,8 @@ bool LobbyClientDisconnected::applyOnLobbyHandler(CServerHandler * handler)
void LobbyClientDisconnected::applyOnLobbyScreen(CLobbyScreen * lobby, CServerHandler * handler)
{
GH.popInts(1);
if(GH.listInt.size())
GH.popInts(1);
}
void LobbyChatMessage::applyOnLobbyScreen(CLobbyScreen * lobby, CServerHandler * handler)

View File

@ -330,7 +330,7 @@ public:
h & players;
h & howManyTeams;
h & allowedHeroes;
h & triggeredEvents;
//Do not serialize triggeredEvents in header as they can contain information about heroes and armies
h & victoryMessage;
h & victoryIconIndex;
h & defeatMessage;
@ -424,6 +424,7 @@ public:
void serialize(Handler &h, const int formatVersion)
{
h & static_cast<CMapHeader&>(*this);
h & triggeredEvents; //from CMapHeader
h & rumors;
h & allowedSpell;
h & allowedAbilities;