Core/Spells: Fixed issues with Death and Decay and similar spells not ticking if players stepping in the AoE are not in LoS with the caster.

Not exactly sure if that behavior should *exactly* be as such, but until more informations ...
This commit is contained in:
Warpten
2014-07-25 14:47:07 +02:00
parent 89f67fc0c3
commit a309ca9727

View File

@@ -4793,8 +4793,15 @@ SpellCastResult Spell::CheckCast(bool strict)
return SPELL_FAILED_NOT_INFRONT;
if (m_caster->GetEntry() != WORLD_TRIGGER) // Ignore LOS for gameobjects casts (wrongly cast by a trigger)
if (!(m_spellInfo->AttributesEx2 & SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS) && !DisableMgr::IsDisabledFor(DISABLE_TYPE_SPELL, m_spellInfo->Id, NULL, SPELL_DISABLE_LOS) && !m_caster->IsWithinLOSInMap(target))
{
WorldObject* losTarget = target;
if (IsTriggered() && m_triggeredByAuraSpell)
if (DynamicObject* dynObj = m_caster->GetDynObject(m_triggeredByAuraSpell))
losTarget = dynObj;
if (!(m_spellInfo->AttributesEx2 & SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS) && !DisableMgr::IsDisabledFor(DISABLE_TYPE_SPELL, m_spellInfo->Id, NULL, SPELL_DISABLE_LOS) && !target->IsWithinLOSInMap(losTarget))
return SPELL_FAILED_LINE_OF_SIGHT;
}
}
}