diff options
| author | krz <none@none> | 2009-06-07 19:06:51 +0200 |
|---|---|---|
| committer | krz <none@none> | 2009-06-07 19:06:51 +0200 |
| commit | 5e87f3144cca2cae1add4acd18affcfbb2d981e5 (patch) | |
| tree | eeefb614ae43804946bf86cdbfb997fba35215e4 /src/game/Spell.cpp | |
| parent | 18f50212b05fbc5fa67c5dc924824b8dea9150f4 (diff) | |
Fix crash in Aura::Update.
Check if target has Invisibility or Stealth aura before checking IsVisibleForOrDetect to allow cast spells on invisible triggers and fix pet linked spells.
Send correct message to client if target is not visible for caster.
Sorry for my previous buging commits.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Spell.cpp')
| -rw-r--r-- | src/game/Spell.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index ecd2852dd7c..411a130539e 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2241,11 +2241,13 @@ void Spell::cast(bool skipCheck) // update pointers base at GUIDs to prevent access to non-existed already object UpdatePointers(); - if(m_targets.getUnitTarget() && m_targets.getUnitTarget()->isAlive() && !m_targets.getUnitTarget()->isVisibleForOrDetect(m_caster, true)) - { - cancel(); - return; - } + if(Unit *pTarget = m_targets.getUnitTarget()) + if(pTarget->isAlive() && (pTarget->HasAuraType(SPELL_AURA_MOD_STEALTH) || pTarget->HasAuraType(SPELL_AURA_MOD_INVISIBILITY)) && !pTarget->IsFriendlyTo(m_caster) && !pTarget->isVisibleForOrDetect(m_caster, true)) + { + SendCastResult(SPELL_FAILED_BAD_TARGETS); + finish(false); + return; + } SetExecutedCurrently(true); uint8 castResult = 0; |
