aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2018-03-10 19:51:36 -0300
committerShauren <shauren.trinity@gmail.com>2021-09-05 22:48:28 +0200
commit60ff73eeba93c7f97abff0eeb504cb4b5ff8a6cd (patch)
treef90cd88a96167914cfe5281a1db786e574f9eef2 /src
parenta2ea26816e19224484377697311f3de1f4cc8f55 (diff)
Core/Spell: fix SendSpellMiss requiring caster Unit
(cherry picked from commit 7f947646f9d51b53b5297bfdddbada09500c53d3)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Object/Object.cpp11
-rw-r--r--src/server/game/Entities/Object/Object.h1
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp9
-rw-r--r--src/server/game/Entities/Unit/Unit.h1
-rw-r--r--src/server/game/Spells/Spell.cpp2
5 files changed, 12 insertions, 12 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*/) { }
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 68ebc0d81dc..b1486b6b2cf 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -5200,15 +5200,6 @@ void Unit::SendPeriodicAuraLog(SpellPeriodicAuraLogInfo* info)
SendCombatLogMessage(&data);
}
-void Unit::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);
-}
-
void Unit::SendSpellDamageResist(Unit* target, uint32 spellId)
{
WorldPackets::CombatLog::ProcResist procResist;
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
index 3f7aa1a4308..696c63bcacf 100644
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -1165,7 +1165,6 @@ class TC_GAME_API Unit : public WorldObject
void SendAttackStateUpdate(uint32 HitInfo, Unit* target, uint8 SwingType, SpellSchoolMask damageSchoolMask, uint32 Damage, uint32 AbsorbDamage, uint32 Resist, VictimState TargetState, uint32 BlockedAmount);
void SendSpellNonMeleeDamageLog(SpellNonMeleeDamage const* log);
void SendPeriodicAuraLog(SpellPeriodicAuraLogInfo* pInfo);
- void SendSpellMiss(Unit* target, uint32 spellID, SpellMissInfo missInfo);
void SendSpellDamageResist(Unit* target, uint32 spellId);
void SendSpellDamageImmune(Unit* target, uint32 spellId, bool isPeriodic);
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index ceca13fdfdf..263d597ef2c 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -2380,7 +2380,7 @@ void Spell::TargetInfo::PreprocessTarget(Spell* spell)
if (missInfo != SPELL_MISS_NONE)
{
if (missInfo != SPELL_MISS_MISS)
- spell->m_caster->ToUnit()->SendSpellMiss(unit, spell->m_spellInfo->Id, missInfo);
+ spell->m_caster->SendSpellMiss(unit, spell->m_spellInfo->Id, missInfo);
spell->m_damage = 0;
spell->m_healing = 0;
_spellHitTarget = nullptr;