aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-06-15 23:35:55 -0500
committermegamage <none@none>2009-06-15 23:35:55 -0500
commitcc527c884e9f643cadfd7ef186fbd419103c867b (patch)
tree94a9ee85042f857393c8859dd0a4a60545ac2254 /src
parent3468424a7ba3d89f9f12a9b11bcace15d4c88055 (diff)
parent5e87f3144cca2cae1add4acd18affcfbb2d981e5 (diff)
*Merge.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Spell.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index d97bd11842d..68cc5c04659 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -1206,7 +1206,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)
// 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->HasAuraType(SPELL_AURA_MOD_INVISIBILITY)
+ && (unit->m_invisibilityMask || m_caster->m_invisibilityMask
|| unit->HasAuraTypeWithFamilyFlags(SPELL_AURA_MOD_STEALTH, SPELLFAMILY_ROGUE, SPELLFAMILYFLAG_ROGUE_VANISH))
&& !m_caster->canSeeOrDetect(unit, true))
{
@@ -2557,12 +2557,16 @@ void Spell::cast(bool skipCheck)
// update pointers base at GUIDs to prevent access to non-existed already object
UpdatePointers();
- if(m_targets.getUnitTarget())
+ if(Unit *target = m_targets.getUnitTarget())
{
// three check: prepare, cast (m_casttime > 0), hit (delayed)
- if(m_casttime && m_targets.getUnitTarget()->isAlive() && !m_caster->canSeeOrDetect(m_targets.getUnitTarget(), true))
+ if(m_casttime && target->isAlive()
+ && (target->m_invisibilityMask || m_caster->m_invisibilityMask
+ || target->GetVisibility() == VISIBILITY_GROUP_STEALTH)
+ && !target->IsFriendlyTo(m_caster) && !m_caster->canSeeOrDetect(target, true))
{
- cancel();
+ SendCastResult(SPELL_FAILED_BAD_TARGETS);
+ finish(false);
return;
}
}