fix(Core/SmartAI): Skip positive spells when determining attack distance (#24381)

Co-authored-by: blinkysc <blinkysc@users.noreply.github.com>
This commit is contained in:
blinkysc
2026-01-12 07:31:13 -06:00
committed by GitHub
parent 7ffef7b5fa
commit 9e6493ff26
2 changed files with 21 additions and 0 deletions

View File

@@ -951,6 +951,14 @@ void SmartAI::InitializeAI()
if (!(event.action.cast.castFlags & SMARTCAST_MAIN_SPELL))
continue;
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(event.action.cast.spell);
if (spellInfo && spellInfo->IsPositive())
{
LOG_WARN("scripts.ai", "SmartAI: Creature {} has SMARTCAST_MAIN_SPELL on positive spell {} - positive spells should not be used as main spell",
me->GetEntry(), event.action.cast.spell);
continue;
}
SetMainSpell(event.action.cast.spell);
break;
}
@@ -966,6 +974,11 @@ void SmartAI::InitializeAI()
if (!(event.action.cast.castFlags & SMARTCAST_COMBAT_MOVE))
continue;
// Don't use positive (healing/buff) spells to determine attack distance
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(event.action.cast.spell);
if (spellInfo && spellInfo->IsPositive())
continue;
SetMainSpell(event.action.cast.spell);
break;
}