1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

INVINCIBLE bonus

This commit is contained in:
Laserlicht
2024-09-19 03:14:45 +02:00
parent 110def5a1e
commit b36c05df1d
9 changed files with 38 additions and 2 deletions

View File

@ -296,6 +296,9 @@ std::vector<BattleHex> CStack::meleeAttackHexes(const battle::Unit * attacker, c
bool CStack::isMeleeAttackPossible(const battle::Unit * attacker, const battle::Unit * defender, BattleHex attackerPos, BattleHex defenderPos)
{
if(defender->hasBonusOfType(BonusType::INVINCIBLE))
return false;
return !meleeAttackHexes(attacker, defender, attackerPos, defenderPos).empty();
}