diff options
author | Nay <dnpd.dd@gmail.com> | 2012-05-28 22:16:47 +0100 |
---|---|---|
committer | Nay <dnpd.dd@gmail.com> | 2012-05-28 22:17:17 +0100 |
commit | e83f913fc501a84d57bb96b308a747e4fce468cb (patch) | |
tree | a2778f2e0b672734d9cc6b83e9fcafcef71b1dc3 /src/server/game/Spells/Spell.cpp | |
parent | 642cf04776784b98c7a4c4a18433b7d642199062 (diff) |
Core/Spells: Ignore LoS when spells are cast/triggered by gameobjects
... and this is why you shouldn't use the so called hacks. You will just
keep adding sh*t on top of more sh*t (like this).
Currently, GO spell casts spawn an invisible WORLD_TRIGGER (npc 12999)
inside of the gameobject (for certain forms of gameobjects) (and
this is why the LoS check was failing).
It shouldn't be like that. GOs should be able to cast the spells without
having to spawn an auxiliary creature.
Fixes "Eye of Acherus" and others
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
-rwxr-xr-x | src/server/game/Spells/Spell.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index de432229e2c..58a89f75fd3 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -585,9 +585,7 @@ m_caster((info->AttributesEx6 & SPELL_ATTR6_CAST_BY_CHARMER && caster->GetCharme CleanupEffectExecuteData(); for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) - { m_destTargets[i] = SpellDestination(*m_caster); - } } Spell::~Spell() @@ -4837,8 +4835,9 @@ SpellCastResult Spell::CheckCast(bool strict) if ((m_spellInfo->AttributesCu & SPELL_ATTR0_CU_REQ_TARGET_FACING_CASTER) && !target->HasInArc(static_cast<float>(M_PI), m_caster)) return SPELL_FAILED_NOT_INFRONT; - if (!(m_spellInfo->AttributesEx2 & SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS) && VMAP::VMapFactory::checkSpellForLoS(m_spellInfo->Id) && !m_caster->IsWithinLOSInMap(target)) - return SPELL_FAILED_LINE_OF_SIGHT; + if (m_caster->GetEntry() != WORLD_TRIGGER) // Ignore LOS for gameobjects casts (wrongly casted by a trigger) + if (!(m_spellInfo->AttributesEx2 & SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS) && VMAP::VMapFactory::checkSpellForLoS(m_spellInfo->Id) && !m_caster->IsWithinLOSInMap(target)) + return SPELL_FAILED_LINE_OF_SIGHT; } else { |