Core/Spell: fix LoS checks for GameObject spells

Port From (https://github.com/TrinityCore/TrinityCore/commit/50fe2dc7e305fa32d30bac6ad0ced2e5647ac02b)
This commit is contained in:
hondacrx
2021-09-08 23:35:22 -04:00
parent b530251d6c
commit b071efe105
3 changed files with 20 additions and 1 deletions
+6
View File
@@ -6557,6 +6557,12 @@ namespace Game.Spells
if (m_spellInfo.HasAttribute(SpellAttr2.CanTargetNotInLos) || Global.DisableMgr.IsDisabledFor(DisableType.Spell, m_spellInfo.Id, null, (byte)DisableFlags.SpellLOS))
return true;
// check if gameobject ignores LOS
GameObject gobCaster = m_caster.ToGameObject();
if (gobCaster != null)
if (!gobCaster.GetGoInfo().GetRequireLOS())
return true;
// if spell is triggered, need to check for LOS disable on the aura triggering it and inherit that behaviour
if (IsTriggered() && m_triggeredByAuraSpell != null && (m_triggeredByAuraSpell.HasAttribute(SpellAttr2.CanTargetNotInLos) || Global.DisableMgr.IsDisabledFor(DisableType.Spell, m_triggeredByAuraSpell.Id, null, (byte)DisableFlags.SpellLOS)))
return true;