Core/Spell: fix SendSpellMiss requiring caster Unit

This commit is contained in:
ariel- authored and Ovahlord committed 2022-09-12 09:15:16 +02:00
1 parent c889b81f2c
commit b3c8d78fa2
5 files changed
+16 -16

No files matched your search

@@ -2717,6 +2717,20 @@ SpellMissInfo WorldObject::SpellHitResult(Unit* victim, SpellInfo const* spellIn
return SPELL_MISS_NONE;
}
void WorldObject::SendSpellMiss(Unit* target, uint32 spellID, SpellMissInfo missInfo)
{
WorldPacket data(SMSG_SPELLLOGMISS, (4 + 8 + 1 + 4 + 8 + 1));
data << uint32(spellID);
data << uint64(GetGUID());
data << uint8(0); // can be 0 or 1
data << uint32(1); // target count
// for (i = 0; i < target count; ++i)
data << uint64(target->GetGUID()); // target GUID
data << uint8(missInfo);
// end loop
SendMessageToSet(&data, true);
}
FactionTemplateEntry const* WorldObject::GetFactionTemplateEntry() const
{
FactionTemplateEntry const* entry = sFactionTemplateStore.LookupEntry(GetFaction());