aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2017-04-12 02:53:25 -0300
committerariel- <ariel-@users.noreply.github.com>2017-04-12 02:53:25 -0300
commit83177e771a373514913d066e14d5a7f9775407fe (patch)
tree11a650b4622df057c0ddfae1f606a6b5ea115428 /src
parent947a1f7be3080270b921e9bf69155bfc068ea301 (diff)
Core/Spell: fix SPELL_ATTR3_IGNORE_HIT_RESULT bypassing reflects
Closes #19440
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index ffffdc1ea01..bd7fdb49e8a 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -2693,18 +2693,6 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit* victim, SpellInfo const* spellInfo
// Resist
SpellMissInfo Unit::SpellHitResult(Unit* victim, SpellInfo const* spellInfo, bool canReflect /*= false*/)
{
- if (spellInfo->HasAttribute(SPELL_ATTR3_IGNORE_HIT_RESULT))
- return SPELL_MISS_NONE;
-
- // Check for immune
- if (victim->IsImmunedToSpell(spellInfo, this))
- return SPELL_MISS_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 SPELL_MISS_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() && !IsHostileTo(victim)) // prevent from affecting enemy by "positive" spell
@@ -2727,6 +2715,18 @@ SpellMissInfo Unit::SpellHitResult(Unit* victim, SpellInfo const* spellInfo, boo
return SPELL_MISS_REFLECT;
}
+ if (spellInfo->HasAttribute(SPELL_ATTR3_IGNORE_HIT_RESULT))
+ return SPELL_MISS_NONE;
+
+ // Check for immune
+ if (victim->IsImmunedToSpell(spellInfo, this))
+ return SPELL_MISS_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 SPELL_MISS_IMMUNE;
+
switch (spellInfo->DmgClass)
{
case SPELL_DAMAGE_CLASS_RANGED: