Skip to content

Commit

Permalink
Spell: Enforce los ignore due to range index 13 for single target tar…
Browse files Browse the repository at this point in the history
…geting
  • Loading branch information
killerwife committed Nov 21, 2023
1 parent aee6207 commit 4c1f84d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/game/Spells/Spell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down
17 changes: 10 additions & 7 deletions src/game/Spells/SpellMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand All @@ -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);
Expand Down

0 comments on commit 4c1f84d

Please sign in to comment.