1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +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

@@ -1555,7 +1555,7 @@ void SwapStacks::applyGs(CGameState *gs)
void InsertNewStack::applyGs(CGameState *gs)
{
if(auto * obj = gs->getArmyInstance(army))
obj->putStack(slot, std::make_unique<CStackInstance>(gs->callback, type, count));
obj->putStack(slot, std::make_unique<CStackInstance>(gs->cb, type, count));
else
throw std::runtime_error("InsertNewStack: invalid army object " + std::to_string(army.getNum()) + ", possible game state corruption.");
}