mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
move checks for invincible bonus to UnitState & cache
This commit is contained in:
@@ -276,7 +276,7 @@ bool BattleActionProcessor::doAttackAction(const CBattleInfoCallback & battle, c
|
||||
for (int i = 0; i < totalAttacks; ++i)
|
||||
{
|
||||
//first strike
|
||||
if(i == 0 && firstStrike && retaliation && !stack->hasBonusOfType(BonusType::BLOCKS_RETALIATION) && !stack->hasBonusOfType(BonusType::INVINCIBLE))
|
||||
if(i == 0 && firstStrike && retaliation && !stack->hasBonusOfType(BonusType::BLOCKS_RETALIATION) && !stack->isInvincible())
|
||||
{
|
||||
makeAttack(battle, destinationStack, stack, 0, stack->getPosition(), true, false, true);
|
||||
}
|
||||
@@ -303,7 +303,7 @@ bool BattleActionProcessor::doAttackAction(const CBattleInfoCallback & battle, c
|
||||
//we check retaliation twice, so if it unblocked during attack it will work only on next attack
|
||||
if(stack->alive()
|
||||
&& !stack->hasBonusOfType(BonusType::BLOCKS_RETALIATION)
|
||||
&& !stack->hasBonusOfType(BonusType::INVINCIBLE)
|
||||
&& !stack->isInvincible()
|
||||
&& (i == 0 && !firstStrike)
|
||||
&& retaliation && destinationStack->ableToRetaliate())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user