mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +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)
|
if (spell->getState() != SPELL_STATE_FINISHED)
|
||||||
spell->cancel(bySelf);
|
spell->cancel(bySelf);
|
||||||
|
else
|
||||||
m_currentSpells[spellType] = nullptr;
|
{
|
||||||
spell->SetReferencedFromCurrent(false);
|
m_currentSpells[spellType] = nullptr;
|
||||||
|
spell->SetReferencedFromCurrent(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4081,13 +4081,15 @@ void Spell::_cast(bool skipCheck)
|
|||||||
if (modOwner)
|
if (modOwner)
|
||||||
modOwner->SetSpellModTakingSpell(this, false);
|
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)
|
for (int32 id : *spell_triggered)
|
||||||
if (*i < 0)
|
{
|
||||||
m_caster->RemoveAurasDueToSpell(-(*i));
|
if (id < 0)
|
||||||
|
m_caster->RemoveAurasDueToSpell(-id);
|
||||||
else
|
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
|
// Interrupt Spell casting
|
||||||
|
|||||||
@@ -733,7 +733,7 @@ struct npc_akama_illidan : public ScriptedAI
|
|||||||
void Reset() override
|
void Reset() override
|
||||||
{
|
{
|
||||||
scheduler.CancelAll();
|
scheduler.CancelAll();
|
||||||
me->m_Events.KillAllEvents(true);
|
me->m_Events.KillAllEvents(false);
|
||||||
me->SetReactState(REACT_AGGRESSIVE);
|
me->SetReactState(REACT_AGGRESSIVE);
|
||||||
if (instance->GetBossState(DATA_ILLIDAN_STORMRAGE) == DONE)
|
if (instance->GetBossState(DATA_ILLIDAN_STORMRAGE) == DONE)
|
||||||
me->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
|
me->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
|
||||||
|
|||||||
Reference in New Issue
Block a user