1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Fix battle ai trying to act with killed stack

This commit is contained in:
Andrii Danylchenko 2023-02-28 09:14:01 +02:00 committed by Andrii Danylchenko
parent 8d3bfbe0bc
commit 5cab8ede90

View File

@ -117,9 +117,9 @@ BattleAction CBattleAI::activeStack( const CStack * stack )
attemptCastingSpell(); attemptCastingSpell();
if(auto ret = cb->battleIsFinished()) if(cb->battleIsFinished() || !stack->alive())
{ {
//spellcast may finish battle //spellcast may finish battle or kill active stack
//send special preudo-action //send special preudo-action
BattleAction cancel; BattleAction cancel;
cancel.actionType = EActionType::CANCEL; cancel.actionType = EActionType::CANCEL;