mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +00:00
fix(Core/Spells): Fix SetSpellModTakingSpell assert from re-entrant calls (#24863)
Co-authored-by: blinkysc <blinkysc@users.noreply.github.com>
This commit is contained in:
@@ -10027,10 +10027,10 @@ bool Player::HasSpellModApplied(SpellModifier* mod, Spell* spell)
|
|||||||
|
|
||||||
void Player::SetSpellModTakingSpell(Spell* spell, bool apply)
|
void Player::SetSpellModTakingSpell(Spell* spell, bool apply)
|
||||||
{
|
{
|
||||||
if (apply && m_spellModTakingSpell)
|
if (apply && m_spellModTakingSpell && m_spellModTakingSpell != spell)
|
||||||
ASSERT(m_spellModTakingSpell == nullptr);
|
return;
|
||||||
else if (!apply)
|
else if (!apply && m_spellModTakingSpell != spell)
|
||||||
ASSERT(m_spellModTakingSpell && m_spellModTakingSpell == spell);
|
return;
|
||||||
|
|
||||||
m_spellModTakingSpell = apply ? spell : nullptr;
|
m_spellModTakingSpell = apply ? spell : nullptr;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user