diff options
| author | ariel- <ariel-@users.noreply.github.com> | 2018-03-10 19:51:36 -0300 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2021-09-05 22:48:28 +0200 |
| commit | 60ff73eeba93c7f97abff0eeb504cb4b5ff8a6cd (patch) | |
| tree | f90cd88a96167914cfe5281a1db786e574f9eef2 /src/server/game/Entities/Object | |
| parent | a2ea26816e19224484377697311f3de1f4cc8f55 (diff) | |
Core/Spell: fix SendSpellMiss requiring caster Unit
(cherry picked from commit 7f947646f9d51b53b5297bfdddbada09500c53d3)
Diffstat (limited to 'src/server/game/Entities/Object')
| -rw-r--r-- | src/server/game/Entities/Object/Object.cpp | 11 | ||||
| -rw-r--r-- | src/server/game/Entities/Object/Object.h | 1 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index fc5af757490..a86d563127a 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -21,7 +21,7 @@ #include "BattlefieldMgr.h" #include "CellImpl.h" #include "CinematicMgr.h" -#include "CombatLogPacketsCommon.h" +#include "CombatLogPackets.h" #include "Common.h" #include "Creature.h" #include "GameTime.h" @@ -2429,6 +2429,15 @@ SpellMissInfo WorldObject::SpellHitResult(Unit* victim, SpellInfo const* spellIn return SPELL_MISS_NONE; } +void WorldObject::SendSpellMiss(Unit* target, uint32 spellID, SpellMissInfo missInfo) +{ + WorldPackets::CombatLog::SpellMissLog spellMissLog; + spellMissLog.SpellID = spellID; + spellMissLog.Caster = GetGUID(); + spellMissLog.Entries.emplace_back(target->GetGUID(), missInfo); + SendMessageToSet(spellMissLog.Write(), true); +} + FactionTemplateEntry const* WorldObject::GetFactionTemplateEntry() const { FactionTemplateEntry const* entry = sFactionTemplateStore.LookupEntry(GetFaction()); diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index 71cfdf548a6..14ccecc2b74 100644 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -581,6 +581,7 @@ class TC_GAME_API WorldObject : public Object, public WorldLocation virtual SpellMissInfo MeleeSpellHitResult(Unit* victim, SpellInfo const* spellInfo) const; SpellMissInfo MagicSpellHitResult(Unit* victim, SpellInfo const* spellInfo) const; SpellMissInfo SpellHitResult(Unit* victim, SpellInfo const* spellInfo, bool canReflect = false) const; + void SendSpellMiss(Unit* target, uint32 spellID, SpellMissInfo missInfo); virtual uint32 GetFaction() const = 0; virtual void SetFaction(uint32 /*faction*/) { } |
