Skip to content

Commit

Permalink
Don't check line of sight when opening chests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ratkosrb committed Nov 14, 2023
1 parent 929ba34 commit d9138ec
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/game/Spells/Spell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6098,19 +6098,6 @@ SpellCastResult Spell::CheckCast(bool strict)
if (goTarget->GetGOInfo()->CannotBeUsedUnderImmunity() && m_casterUnit && m_casterUnit->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE))
return SPELL_FAILED_DAMAGE_IMMUNE;
#endif

// Require LOS to loot chests
// For example, check LoS when opening a gobj (spell 6477).
// Prevents abuse with object id 165554 for example.
if (goTarget->GetGoType() == GAMEOBJECT_TYPE_CHEST)
{
if (!m_IsTriggeredSpell && !(m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_IGNORE_LINE_OF_SIGHT)
&& !goTarget->GetGOInfo()->chest.minSuccessOpens // don't check for gathering nodes, too many are halfway in walls
&& !goTarget->HasFlag(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND) // don't check for quest items
&& !(goTarget->GetEntry() == 160845) // exemption for Dark Coffer
&& !m_caster->IsWithinLOSInMap(goTarget, false))
return SPELL_FAILED_LINE_OF_SIGHT;
}
}
else if (m_targets.IsEmpty())
{
Expand Down

0 comments on commit d9138ec

Please sign in to comment.