diff --git a/src/game/Spells/Spell.cpp b/src/game/Spells/Spell.cpp index ecee2d54c1..00919b8620 100644 --- a/src/game/Spells/Spell.cpp +++ b/src/game/Spells/Spell.cpp @@ -4941,7 +4941,7 @@ SpellCastResult Spell::CheckCast(bool strict) { if (!pet->IsAlive()) return SPELL_FAILED_TARGETS_DEAD; - if (!IsIgnoreLosSpellEffect(m_spellInfo, SpellEffectIndex(i)) && !m_caster->IsWithinLOSInMap(pet, true)) + if (!IsIgnoreLosSpellEffect(m_spellInfo, SpellEffectIndex(i), false) && !m_caster->IsWithinLOSInMap(pet, true)) return SPELL_FAILED_LINE_OF_SIGHT; } break; @@ -6987,7 +6987,7 @@ bool Spell::CheckTarget(Unit* target, SpellEffectIndex eff, bool targetB, CheckE // all ok by some way or another, skip normal check break; default: // normal case - if (exception != EXCEPTION_MAGNET && !IsIgnoreLosSpellEffect(m_spellInfo, eff)) + if (exception != EXCEPTION_MAGNET && !IsIgnoreLosSpellEffect(m_spellInfo, eff, targetB)) { float x, y, z; switch (info.los) diff --git a/src/game/Spells/SpellMgr.h b/src/game/Spells/SpellMgr.h index 376f2a8c70..32b00560f3 100644 --- a/src/game/Spells/SpellMgr.h +++ b/src/game/Spells/SpellMgr.h @@ -1437,7 +1437,12 @@ inline bool IsIgnoreLosSpell(SpellEntry const* spellInfo) return spellInfo->HasAttribute(SPELL_ATTR_EX2_IGNORE_LINE_OF_SIGHT); } -inline bool IsIgnoreLosSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex effIdx) +inline bool IsIgnoreLosSpellCast(SpellEntry const* spellInfo) +{ + return spellInfo->rangeIndex == 13 || IsIgnoreLosSpell(spellInfo); +} + +inline bool IsIgnoreLosSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex effIdx, bool targetB) { // TODO: Move this to target logic switch (spellInfo->EffectImplicitTargetA[effIdx]) @@ -1446,17 +1451,15 @@ inline bool IsIgnoreLosSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex case TARGET_UNIT_FRIEND_AND_PARTY: case TARGET_UNIT_RAID_AND_CLASS: case TARGET_ENUM_UNITS_PARTY_WITHIN_CASTER_RANGE: return true; - default: break; + default: + if (IsCheckCastTarget(targetB ? spellInfo->EffectImplicitTargetB[effIdx] : spellInfo->EffectImplicitTargetA[effIdx])) + return IsIgnoreLosSpellCast(spellInfo); + break; } return spellInfo->EffectRadiusIndex[effIdx] == 28 || IsIgnoreLosSpell(spellInfo); } -inline bool IsIgnoreLosSpellCast(SpellEntry const* spellInfo) -{ - return spellInfo->rangeIndex == 13 || IsIgnoreLosSpell(spellInfo); -} - inline bool NeedsComboPoints(SpellEntry const* spellInfo) { return spellInfo->HasAttribute(SPELL_ATTR_EX_FINISHING_MOVE_DAMAGE) || spellInfo->HasAttribute(SPELL_ATTR_EX_FINISHING_MOVE_DURATION);