mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-21 20:56:23 +00:00
fix(Core/Spells): Fix crash (#20179)
Co-authored-by: Ariel Silva <ariel-@users.noreply.github.com>
This commit is contained in:
@@ -4076,9 +4076,11 @@ void Unit::InterruptSpell(CurrentSpellTypes spellType, bool withDelayed, bool wi
|
||||
|
||||
if (spell->getState() != SPELL_STATE_FINISHED)
|
||||
spell->cancel(bySelf);
|
||||
|
||||
m_currentSpells[spellType] = nullptr;
|
||||
spell->SetReferencedFromCurrent(false);
|
||||
else
|
||||
{
|
||||
m_currentSpells[spellType] = nullptr;
|
||||
spell->SetReferencedFromCurrent(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4081,13 +4081,15 @@ void Spell::_cast(bool skipCheck)
|
||||
if (modOwner)
|
||||
modOwner->SetSpellModTakingSpell(this, false);
|
||||
|
||||
if (const std::vector<int32>* spell_triggered = sSpellMgr->GetSpellLinked(m_spellInfo->Id))
|
||||
if (std::vector<int32> const* spell_triggered = sSpellMgr->GetSpellLinked(m_spellInfo->Id))
|
||||
{
|
||||
for (std::vector<int32>::const_iterator i = spell_triggered->begin(); i != spell_triggered->end(); ++i)
|
||||
if (*i < 0)
|
||||
m_caster->RemoveAurasDueToSpell(-(*i));
|
||||
for (int32 id : *spell_triggered)
|
||||
{
|
||||
if (id < 0)
|
||||
m_caster->RemoveAurasDueToSpell(-id);
|
||||
else
|
||||
m_caster->CastSpell(m_targets.GetUnitTarget() ? m_targets.GetUnitTarget() : m_caster, *i, true);
|
||||
m_caster->CastSpell(m_targets.GetUnitTarget() ? m_targets.GetUnitTarget() : m_caster, id, true);
|
||||
}
|
||||
}
|
||||
|
||||
// Interrupt Spell casting
|
||||
|
||||
@@ -733,7 +733,7 @@ struct npc_akama_illidan : public ScriptedAI
|
||||
void Reset() override
|
||||
{
|
||||
scheduler.CancelAll();
|
||||
me->m_Events.KillAllEvents(true);
|
||||
me->m_Events.KillAllEvents(false);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
if (instance->GetBossState(DATA_ILLIDAN_STORMRAGE) == DONE)
|
||||
me->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
|
||||
|
||||
Reference in New Issue
Block a user