diff options
| author | linencloth <none@none> | 2010-11-13 18:04:56 +0100 |
|---|---|---|
| committer | linencloth <none@none> | 2010-11-13 18:04:56 +0100 |
| commit | 880ef0c398a043b60d18e750c420dd8209272cb3 (patch) | |
| tree | 0a1296ba298b52630df38576a74132b6cceb56d1 /src/server/game/Spells/SpellEffects.cpp | |
| parent | bf888285aab32ae2571002f23dd217396b2f12d8 (diff) | |
Core/Spells: Fix spelleffect sanctuary
- No longer removes every attacker, but updates the visibility
- Using that effect won't remove attackers that can still see through the stealth of the caster based on distance
- Ignores spells that were casted before or at the same time of that effect
- Trigger other needed spells when casting Shadowmeld
--HG--
branch : trunk
Diffstat (limited to 'src/server/game/Spells/SpellEffects.cpp')
| -rwxr-xr-x | src/server/game/Spells/SpellEffects.cpp | 22 |
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 |
