Core/Spell: fix SpellAttr3.IgnoreHitResult bypassing reflects

Port From (https://github.com/TrinityCore/TrinityCore/commit/fc0a037eef2a6a1dd1cc43f0233aaa1d400393be)
This commit is contained in:
hondacrx
2020-05-12 20:22:53 -04:00
parent c7f160557f
commit f5ead031f4
+12 -12
View File
@@ -749,18 +749,6 @@ namespace Game.Entities
// Resist
public SpellMissInfo SpellHitResult(Unit victim, SpellInfo spellInfo, bool canReflect = false)
{
if (spellInfo.HasAttribute(SpellAttr3.IgnoreHitResult))
return SpellMissInfo.None;
// Check for immune
if (victim.IsImmunedToSpell(spellInfo, this))
return SpellMissInfo.Immune;
// Damage immunity is only checked if the spell has damage effects, this immunity must not prevent aura apply
// returns SPELL_MISS_IMMUNE in that case, for other spells, the SMSG_SPELL_GO must show hit
if (spellInfo.HasOnlyDamageEffects() && victim.IsImmunedToDamage(spellInfo))
return SpellMissInfo.Immune;
// All positive spells can`t miss
// @todo client not show miss log for this spells - so need find info for this in dbc and use it!
if (spellInfo.IsPositive()
@@ -784,6 +772,18 @@ namespace Game.Entities
return SpellMissInfo.Reflect;
}
if (spellInfo.HasAttribute(SpellAttr3.IgnoreHitResult))
return SpellMissInfo.None;
// Check for immune
if (victim.IsImmunedToSpell(spellInfo, this))
return SpellMissInfo.Immune;
// Damage immunity is only checked if the spell has damage effects, this immunity must not prevent aura apply
// returns SPELL_MISS_IMMUNE in that case, for other spells, the SMSG_SPELL_GO must show hit
if (spellInfo.HasOnlyDamageEffects() && victim.IsImmunedToDamage(spellInfo))
return SpellMissInfo.Immune;
switch (spellInfo.DmgClass)
{
case SpellDmgClass.Ranged: