mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-22 22:13:35 +02:00
Merge pull request #4920 from kdmcser/fix_attack_crash
fix crash: spell before attack kill defender will lead to crash
This commit is contained in:
commit
877d11d4c0
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user