mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 10:26:28 +01:00
Core/Spell: fix SendSpellMiss requiring caster Unit
(cherry picked from commit 7f947646f9)
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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*/) { }
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user