1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-12-01 23:12:49 +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

@@ -685,6 +685,9 @@ bool CBattleInfoCallback::battleCanAttack(const battle::Unit * stack, const batt
if (!stack || !target)
return false;
if(target->hasBonusOfType(BonusType::INVINCIBLE))
return false;
if(!battleMatchOwner(stack, target))
return false;
@@ -730,6 +733,9 @@ bool CBattleInfoCallback::battleCanShoot(const battle::Unit * attacker, BattleHe
if(!attacker || !defender)
return false;
if(defender->hasBonusOfType(BonusType::INVINCIBLE))
return false;
if(battleMatchOwner(attacker, defender) && defender->alive())
{
if(battleCanShoot(attacker))