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;
-7
View File
@@ -446,13 +446,6 @@ namespace Game.Entities
// It will be recalculate at mailbox open (for unReadMails important non-0 until mailbox open, it also will be recalculated)
m_nextMailDelivereTime = 0;
}
// If this is set during update SetSpellModTakingSpell call is missing somewhere in the code
// Having this would prevent more aura charges to be dropped, so let's crash
if (m_spellModTakingSpell != null)
{
Log.outFatal(LogFilter.Spells, "Player has m_spellModTakingSpell {0} during update!", m_spellModTakingSpell.m_spellInfo.Id);
m_spellModTakingSpell = null;
}
// Update cinematic location, if 500ms have passed and we're doing a cinematic now.
_cinematicMgr.m_cinematicDiff += diff;