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:
@@ -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.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user