1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-26 03:52:01 +02:00

Fixed CID 1375686

This commit is contained in:
AlexVinS 2017-05-28 15:00:55 +03:00
parent f5cdaece6f
commit 25d06c8d70

View File

@ -3982,6 +3982,11 @@ bool CGameHandler::makeBattleAction(BattleAction &ba)
complain("Cannot shoot!"); complain("Cannot shoot!");
break; break;
} }
if (!destinationStack)
{
complain("No target to shoot!");
break;
}
auto wrapper = wrapAction(ba); auto wrapper = wrapAction(ba);
@ -3995,8 +4000,7 @@ bool CGameHandler::makeBattleAction(BattleAction &ba)
} }
//ranged counterattack //ranged counterattack
if (destinationStack if (destinationStack->hasBonusOfType(Bonus::RANGED_RETALIATION)
&& destinationStack->hasBonusOfType(Bonus::RANGED_RETALIATION)
&& !stack->hasBonusOfType(Bonus::BLOCKS_RANGED_RETALIATION) && !stack->hasBonusOfType(Bonus::BLOCKS_RANGED_RETALIATION)
&& destinationStack->ableToRetaliate() && destinationStack->ableToRetaliate()
&& stack->alive()) //attacker may have died (fire shield) && stack->alive()) //attacker may have died (fire shield)