1
0
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:
Ivan Savenko 2024-11-18 12:56:37 +02:00 committed by GitHub
commit 877d11d4c0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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;