Fixed setting and unsetting of m_spellModTakingSpell

Port From (https://github.com/TrinityCore/TrinityCore/commit/fb5c07ffe8d72d32a2c47cfa41dfb3a952160b72)
This commit is contained in:
hondacrx
2019-08-17 13:04:19 -04:00
parent f2f8afb7a4
commit 1e4b1366c2
4 changed files with 25 additions and 38 deletions
+2 -2
View File
@@ -2969,10 +2969,10 @@ namespace Game.Entities
public void SetSpellModTakingSpell(Spell spell, bool apply)
{
if (spell == null || (m_spellModTakingSpell != null && m_spellModTakingSpell != spell))
if (apply && m_spellModTakingSpell != null)
return;
if (apply && spell.getState() == SpellState.Finished)
if (!apply && (m_spellModTakingSpell == null || m_spellModTakingSpell != spell))
return;
m_spellModTakingSpell = apply ? spell : null;