1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-05 00:49:09 +02:00

Fixes for several discovered edge cases

This commit is contained in:
Ivan Savenko
2023-08-17 16:17:19 +03:00
parent a1092e0f3f
commit c516b5a64e
5 changed files with 34 additions and 23 deletions

View File

@ -2284,14 +2284,12 @@ void StartAction::applyGs(CGameState *gs)
return;
}
if(ba.actionType != EActionType::HERO_SPELL) //don't check for stack if it's custom action by hero
{
assert(st);
}
else
{
[[maybe_unused]] bool heroAction = ba.actionType == EActionType::HERO_SPELL || ba.actionType ==EActionType::SURRENDER || ba.actionType ==EActionType::RETREAT || ba.actionType == EActionType::END_TACTIC_PHASE;
assert(st || heroAction); // stack must exists for all non-hero actions
if(ba.actionType == EActionType::HERO_SPELL)
gs->curB->sides[ba.side].usedSpellsHistory.emplace_back(ba.actionSubtype);
}
switch(ba.actionType)
{