aboutsummaryrefslogtreecommitdiff
path: root/src/game/Spell.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-06-07 11:36:41 -0500
committermegamage <none@none>2009-06-07 11:36:41 -0500
commitc48c20cb9866d22f1b03159ae258310ab10a9263 (patch)
tree9bff30e856003bb7be850979409906007dc34893 /src/game/Spell.cpp
parent73299773235259a2bd2272f0c54b01a2435b7a01 (diff)
parenta29847bf8490833ba219f01fba1441d6c8f1b7a3 (diff)
*Merge. Note: A better way is needed for Sanctuary effect. (interrupt all spells towards self).
--HG-- branch : trunk
Diffstat (limited to 'src/game/Spell.cpp')
-rw-r--r--src/game/Spell.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 49327ed359f..4b410480ebe 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -1036,7 +1036,8 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
SpellMissInfo missInfo = DoSpellHitOnUnit(spellHitTarget, mask);
if(missInfo != SPELL_MISS_NONE)
{
- m_caster->SendSpellMiss(unit, m_spellInfo->Id, missInfo);
+ if(missInfo != SPELL_MISS_MISS)
+ m_caster->SendSpellMiss(unit, m_spellInfo->Id, missInfo);
m_damage = 0;
spellHitTarget = NULL;
}
@@ -1186,10 +1187,17 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)
if( !m_caster->IsFriendlyTo(unit) )
{
+ // reset damage to 0 if target has Invisibility or Vanish aura (_only_ vanish, not stealth) and isn't visible for caster
+ // I do not think this is a correct way to fix it. Sanctuary effect should make all delayed spells invalid
// for delayed spells ignore not visible explicit target
- if(m_spellInfo->speed > 0.0f && unit == m_targets.getUnitTarget() && !unit->isVisibleForOrDetect(m_caster,false))
+ if(m_spellInfo->speed > 0.0f && unit == m_targets.getUnitTarget()
+ && (unit->HasAuraType(SPELL_AURA_MOD_INVISIBILITY)
+ || unit->HasAuraTypeWithFamilyFlags(SPELL_AURA_MOD_STEALTH, SPELLFAMILY_ROGUE, SPELLFAMILYFLAG_ROGUE_VANISH))
+ && !unit->isVisibleForOrDetect(m_caster, true))
{
- return SPELL_MISS_EVADE;
+ // that was causing CombatLog errors
+ // return SPELL_MISS_EVADE;
+ return SPELL_MISS_MISS; // miss = do not send anything here
}
unit->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_HITBYSPELL);