aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellEffects.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Spells/SpellEffects.cpp')
-rwxr-xr-xsrc/server/game/Spells/SpellEffects.cpp22
1 files changed, 2 insertions, 20 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index b2fc0ec4032..d1bb898d228 100755
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -5326,27 +5326,9 @@ void Spell::EffectSanctuary(SpellEffIndex /*effIndex*/)
if (!unitTarget)
return;
- std::list<Unit*> targets;
- Trinity::AnyUnfriendlyUnitInObjectRangeCheck u_check(unitTarget, unitTarget, m_caster->GetMap()->GetVisibilityRange());
- Trinity::UnitListSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck> searcher(unitTarget, targets, u_check);
- unitTarget->VisitNearbyObject(m_caster->GetMap()->GetVisibilityRange(), searcher);
- for (std::list<Unit*>::iterator iter = targets.begin(); iter != targets.end(); ++iter)
- {
- if (!(*iter)->hasUnitState(UNIT_STAT_CASTING))
- continue;
-
- for (uint32 i = CURRENT_FIRST_NON_MELEE_SPELL; i < CURRENT_MAX_SPELL; i++)
- {
- if ((*iter)->GetCurrentSpell(i)
- && (*iter)->GetCurrentSpell(i)->m_targets.getUnitTargetGUID() == unitTarget->GetGUID())
- {
- (*iter)->InterruptSpell(CurrentSpellTypes(i), false);
- }
- }
- }
+ unitTarget->getHostileRefManager().UpdateVisibility();
+ unitTarget->m_lastSanctuaryTime = getMSTime();
- unitTarget->CombatStop();
- unitTarget->getHostileRefManager().deleteReferences(); // stop all fighting
// Vanish allows to remove all threat and cast regular stealth so other spells can be used
if (m_caster->GetTypeId() == TYPEID_PLAYER
&& m_spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE