mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
Fixed crash at double attack, including #1202.
This commit is contained in:
@@ -3462,10 +3462,13 @@ bool CGameHandler::makeBattleAction( BattleAction &ba )
|
||||
|
||||
for (int i = 0; i < totalAttacks; ++i)
|
||||
{
|
||||
if( stack &&stack->alive()) //move can cause death, eg. by walking into the moat
|
||||
if (stack &&
|
||||
stack->alive() && //move can cause death, eg. by walking into the moat
|
||||
stackAtEnd->alive())
|
||||
{
|
||||
BattleAttack bat;
|
||||
prepareAttack(bat, stack, stackAtEnd, distance, ba.additionalInfo);
|
||||
prepareAttack(bat, stack, stackAtEnd, (i ? 0 : distance), ba.additionalInfo); //no distance travelled on second attack
|
||||
//prepareAttack(bat, stack, stackAtEnd, 0, ba.additionalInfo);
|
||||
handleAttackBeforeCasting(bat); //only before first attack
|
||||
sendAndApply(&bat);
|
||||
handleAfterAttackCasting(bat);
|
||||
|
||||
Reference in New Issue
Block a user