1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-21 17:17:06 +02:00

fix crash: defender is killed by spell before attack, but attacker still do attack action

This commit is contained in:
kdmcser 2024-11-17 00:28:25 +08:00
parent 7be44278d7
commit 7cb8ca174e

View File

@ -916,6 +916,10 @@ void BattleActionProcessor::makeAttack(const CBattleInfoCallback & battle, const
if(defender && first && !counter)
handleAttackBeforeCasting(battle, ranged, attacker, defender);
// If the attacker or defender is not alive before the attack action, the action should be skipped.
if((attacker && !attacker->alive()) || (defender && !defender->alive()))
return;
FireShieldInfo fireShield;
BattleAttack bat;
BattleLogMessage blm;