Core/Spell: fix SendSpellMiss requiring caster Unit
This commit is contained in:
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());
|
||||
|
||||
@@ -450,6 +450,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*/) { }
|
||||
|
||||
@@ -5108,20 +5108,6 @@ void Unit::SendPeriodicAuraLog(SpellPeriodicAuraLogInfo* pInfo)
|
||||
SendMessageToSet(&data, true);
|
||||
}
|
||||
|
||||
void Unit::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);
|
||||
}
|
||||
|
||||
void Unit::SendSpellDamageResist(Unit* target, uint32 spellId)
|
||||
{
|
||||
WorldPacket data(SMSG_PROCRESIST, 8+8+4+1);
|
||||
|
||||
@@ -1178,7 +1178,6 @@ class TC_GAME_API Unit : public WorldObject
|
||||
void SendSpellNonMeleeDamageLog(SpellNonMeleeDamage* log);
|
||||
void SendSpellNonMeleeDamageLog(Unit* target, uint32 SpellID, uint32 Damage, SpellSchoolMask damageSchoolMask, uint32 AbsorbedDamage, uint32 Resist, bool PhysicalDamage, uint32 Blocked, bool CriticalHit = false);
|
||||
void SendPeriodicAuraLog(SpellPeriodicAuraLogInfo* pInfo);
|
||||
void SendSpellMiss(Unit* target, uint32 spellID, SpellMissInfo missInfo);
|
||||
void SendSpellDamageResist(Unit* target, uint32 spellId);
|
||||
void SendSpellDamageImmune(Unit* target, uint32 spellId);
|
||||
|
||||
|
||||
@@ -2450,7 +2450,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