1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-14 02:33:51 +02:00

Fix paths deserialization

This commit is contained in:
Adriankhl 2023-03-13 11:04:06 +01:00
parent eba4e4dd2c
commit 113527c80c

View File

@ -310,8 +310,7 @@ void CClient::serialize(BinaryDeserializer & h, const int version)
nInt->human = isHuman;
nInt->playerID = pid;
nInt->loadGame(h, version);
bool shouldResetInterface = true;
// Client no longer handle this player at all
if(!vstd::contains(CSH->getAllClientPlayers(CSH->c->connectionID), pid))
{
@ -328,10 +327,18 @@ void CClient::serialize(BinaryDeserializer & h, const int version)
else
{
installNewPlayerInterface(nInt, pid);
continue;
shouldResetInterface = false;
}
// loadGame needs to be called after initGameInterface to load paths correctly
// initGameInterface is called in installNewPlayerInterface
nInt->loadGame(h, version);
if (shouldResetInterface)
{
nInt.reset();
LOCPLINT = prevInt;
}
nInt.reset();
LOCPLINT = prevInt;
}
#if SCRIPTING_ENABLED