1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-23 00:28:08 +02:00

Fix crashes on game start, gamestate now derives from GameCallbackHolder

This commit is contained in:
Ivan Savenko
2025-04-01 15:59:08 +03:00
parent d34b47bb20
commit d1d2cf4189
21 changed files with 99 additions and 81 deletions

View File

@ -118,7 +118,7 @@ void CClient::newGame(std::shared_ptr<CGameState> initializedGameState)
CMapService mapService;
assert(initializedGameState);
gamestate = initializedGameState;
gamestate->preInit(LIBRARY, this);
gamestate->preInit(LIBRARY);
logNetwork->trace("\tCreating gamestate: %i", GAME->server().th->getDiff());
initMapHandler();
@ -133,7 +133,7 @@ void CClient::loadGame(std::shared_ptr<CGameState> initializedGameState)
logNetwork->info("Game state was transferred over network, loading.");
gamestate = initializedGameState;
gamestate->preInit(LIBRARY, this);
gamestate->preInit(LIBRARY);
gamestate->updateOnLoad(GAME->server().si.get());
logNetwork->info("Game loaded, initialize interfaces.");