fix: Crash on unit charm (#15256)

This commit is contained in:
Angelo Venturini
2023-03-04 12:31:05 -03:00
committed by GitHub
parent 5b0b02259b
commit 428f8e0aaa

View File

@@ -15888,7 +15888,10 @@ bool CharmInfo::AddSpellToActionBar(SpellInfo const* spellInfo, ActiveStates new
{
WorldPacket data;
creature->BuildCooldownPacket(data, SPELL_COOLDOWN_FLAG_NONE, spell_id, cooldown);
creature->GetCharmer()->ToPlayer()->SendDirectMessage(&data);
if (creature->GetCharmer() && creature->GetCharmer()->IsPlayer())
{
creature->GetCharmer()->ToPlayer()->SendDirectMessage(&data);
}
}
}, 500ms);
}