Skip to content

Commit 3fe1bcb

Browse files
authored
Targets: Check for positive auras only (#233)
1 parent 9a8afd5 commit 3fe1bcb

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

playerbot/strategy/values/PossibleAttackTargetsValue.cpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -177,15 +177,18 @@ bool PossibleAttackTargetsValue::IsImmuneToDamage(Unit* target, Player* player)
177177
{
178178
for (const Aura* aura : ai->GetAuras(target))
179179
{
180+
if (!aura->IsPositive())
181+
continue;
182+
180183
const SpellEntry* spellInfo = aura->GetSpellProto();
181-
if (spellInfo)
184+
if (!spellInfo)
185+
continue;
186+
187+
if (spellInfo->Mechanic == MECHANIC_BANISH ||
188+
spellInfo->Mechanic == MECHANIC_INVULNERABILITY ||
189+
spellInfo->Mechanic == MECHANIC_IMMUNE_SHIELD)
182190
{
183-
if (spellInfo->Mechanic == MECHANIC_BANISH ||
184-
spellInfo->Mechanic == MECHANIC_INVULNERABILITY ||
185-
spellInfo->Mechanic == MECHANIC_IMMUNE_SHIELD)
186-
{
187-
return true;
188-
}
191+
return true;
189192
}
190193
}
191194
}

0 commit comments

Comments
 (0)