1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-10 22:31:40 +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;