1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-31 22:05:10 +02:00

Fix case when defender creature is killed with pre-attack spell like liches death ripple

This commit is contained in:
Andrii Danylchenko 2022-05-14 17:38:06 +03:00
parent 6c36a1a2f6
commit b269d7fed6

View File

@ -1071,8 +1071,12 @@ void CPlayerInterface::battleAttack(const BattleAttack * ba)
else else
shift = -1; shift = -1;
} }
const CStack * attacked = cb->battleGetStackByID(ba->bsa.begin()->stackAttacked);
battleInt->stackAttacking(attacker, ba->counter() ? BattleHex(attackTarget + shift) : attackTarget, attacked, false); if(!ba->bsa.empty())
{
const CStack * attacked = cb->battleGetStackByID(ba->bsa.begin()->stackAttacked);
battleInt->stackAttacking(attacker, ba->counter() ? BattleHex(attackTarget + shift) : attackTarget, attacked, false);
}
} }
//battleInt->waitForAnims(); //FIXME: freeze //battleInt->waitForAnims(); //FIXME: freeze