Skip to content

Commit cf988b4

Browse files
committed
PetAI: Call IsPositiveSpell() with SpellEntry to avoid double lookup
1 parent cef9c11 commit cf988b4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/game/AI/BaseAI/PetAI.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ std::pair<Unit*, Spell*> PetAI::PickSpellWithTarget(Unit* owner, Unit* victim, C
283283
// 1. Not ready.
284284
// 2. Non-combat spells while in combat (f.e., Succubus's Lesser Invisibility).
285285
// 3. Combat spells while not in combat.
286-
if (!spellInfo || !m_unit->IsSpellReady(*spellInfo) || (m_inCombat && IsNonCombatSpell(spellInfo)) || (!m_inCombat && !IsPositiveSpell(spellInfo->Id)))
286+
if (!spellInfo || !m_unit->IsSpellReady(*spellInfo) || (m_inCombat && IsNonCombatSpell(spellInfo)) || (!m_inCombat && !IsPositiveSpell(spellInfo)))
287287
continue;
288288

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

0 commit comments

Comments
 (0)