fix(Core/Spells): possible crashes within class spells (#9168)

This commit is contained in:
Nefertumm
2021-11-21 11:41:51 -03:00
committed by GitHub
parent 92b3617f63
commit 61c7488698
9 changed files with 66 additions and 25 deletions

View File

@@ -743,11 +743,16 @@ class spell_gen_proc_once_per_cast : public AuraScript
bool CheckProc(ProcEventInfo& eventInfo)
{
if (Player* player = eventInfo.GetActor()->ToPlayer())
if (eventInfo.GetActor())
{
if (player->m_spellModTakingSpell == _spellPointer)
return false;
_spellPointer = player->m_spellModTakingSpell;
if (Player* player = eventInfo.GetActor()->ToPlayer())
{
if (player->m_spellModTakingSpell == _spellPointer)
{
return false;
}
_spellPointer = player->m_spellModTakingSpell;
}
}
return true;
}