mirror of
https://github.com/vcmi/vcmi.git
synced 2025-12-01 23:12:49 +02:00
INVINCIBLE bonus
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user