diff options
author | ariel- <ariel-@users.noreply.github.com> | 2018-03-15 02:59:08 -0300 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2021-09-06 21:15:01 +0200 |
commit | cfe69470a888082f21a639560f54e9c9ed2f3512 (patch) | |
tree | d7d1e13067aa463e7f52a453751587449056aaf2 | |
parent | 376ac0eeba03cdad75fd8493afd647fcf6bff94e (diff) |
Core/Entities: don't skip immunity checks for positive spells
Closes #21626
(cherry picked from commit 9e0a343f729eb7e172c447dccb066f4f236aa11e)
-rw-r--r-- | src/server/game/Entities/Object/Object.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index bbd063c8695..becde162ffb 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -2382,6 +2382,15 @@ SpellMissInfo WorldObject::MagicSpellHitResult(Unit* victim, SpellInfo const* sp // Resist SpellMissInfo WorldObject::SpellHitResult(Unit* victim, SpellInfo const* spellInfo, bool canReflect /*= false*/) const { + // 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 @@ -2407,15 +2416,6 @@ SpellMissInfo WorldObject::SpellHitResult(Unit* victim, SpellInfo const* spellIn 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: |