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:
@@ -916,6 +916,10 @@ void BattleActionProcessor::makeAttack(const CBattleInfoCallback & battle, const
|
|||||||
if(defender && first && !counter)
|
if(defender && first && !counter)
|
||||||
handleAttackBeforeCasting(battle, ranged, attacker, defender);
|
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;
|
FireShieldInfo fireShield;
|
||||||
BattleAttack bat;
|
BattleAttack bat;
|
||||||
BattleLogMessage blm;
|
BattleLogMessage blm;
|
||||||
|
Reference in New Issue
Block a user