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
This commit is contained in:
@@ -185,3 +185,18 @@ void HostileRefManager::setOnlineOfflineState(Unit *pCreature, bool bIsOnline)
|
||||
|
||||
//=================================================
|
||||
|
||||
void HostileRefManager::UpdateVisibility()
|
||||
{
|
||||
HostileReference* ref = getFirst();
|
||||
while (ref)
|
||||
{
|
||||
HostileReference* nextRef = ref->next();
|
||||
if (!ref->getSource()->getOwner()->canSeeOrDetect(getOwner()))
|
||||
{
|
||||
HostileReference* nextRef = ref->next();
|
||||
ref->removeReference();
|
||||
delete ref;
|
||||
}
|
||||
ref = nextRef;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user