mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 10:00:28 +00:00
fix(Core/SAI): Force SMC creatures to resume chasing victims once in… (#22581)
This commit is contained in:
@@ -53,6 +53,7 @@
|
||||
#include "Player.h"
|
||||
#include "ReputationMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "SmartAI.h"
|
||||
#include "Spell.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellAuras.h"
|
||||
@@ -4109,8 +4110,8 @@ void Unit::InterruptSpell(CurrentSpellTypes spellType, bool withDelayed, bool wi
|
||||
//LOG_DEBUG("entities.unit", "Interrupt spell for unit {}.", GetEntry());
|
||||
Spell* spell = m_currentSpells[spellType];
|
||||
if (spell
|
||||
&& (withDelayed || spell->getState() != SPELL_STATE_DELAYED)
|
||||
&& (withInstant || spell->GetCastTime() > 0 || spell->getState() == SPELL_STATE_CASTING)) // xinef: or spell is in casting state (channeled spells only)
|
||||
&& (withDelayed || spell->getState() != SPELL_STATE_DELAYED)
|
||||
&& (withInstant || spell->GetCastTime() > 0 || spell->getState() == SPELL_STATE_CASTING)) // xinef: or spell is in casting state (channeled spells only)
|
||||
{
|
||||
// for example, do not let self-stun aura interrupt itself
|
||||
if (!spell->IsInterruptable())
|
||||
@@ -4128,6 +4129,15 @@ void Unit::InterruptSpell(CurrentSpellTypes spellType, bool withDelayed, bool wi
|
||||
m_currentSpells[spellType] = nullptr;
|
||||
spell->SetReferencedFromCurrent(false);
|
||||
}
|
||||
|
||||
// SAI creatures only
|
||||
// Start chasing victim if they are spell casters (at least one SMC spell) if interrupted/silenced.
|
||||
if (IsCreature())
|
||||
{
|
||||
if (SmartAI* ai = dynamic_cast<SmartAI*>(ToCreature()->AI()))
|
||||
if (ai->CanChaseOnInterrupt())
|
||||
ai->SetCombatMove(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user