Skip to content

Commit

Permalink
PetAI: Call IsPositiveSpell() with SpellEntry to avoid double lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
deiteris committed Nov 3, 2023
1 parent cef9c11 commit cf988b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/game/AI/BaseAI/PetAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ std::pair<Unit*, Spell*> PetAI::PickSpellWithTarget(Unit* owner, Unit* victim, C
// 1. Not ready.
// 2. Non-combat spells while in combat (f.e., Succubus's Lesser Invisibility).
// 3. Combat spells while not in combat.
if (!spellInfo || !m_unit->IsSpellReady(*spellInfo) || (m_inCombat && IsNonCombatSpell(spellInfo)) || (!m_inCombat && !IsPositiveSpell(spellInfo->Id)))
if (!spellInfo || !m_unit->IsSpellReady(*spellInfo) || (m_inCombat && IsNonCombatSpell(spellInfo)) || (!m_inCombat && !IsPositiveSpell(spellInfo)))
continue;

Spell* spell = new Spell(m_unit, spellInfo, flags);
Expand Down

0 comments on commit cf988b4

Please sign in to comment.