From 2095daca858d75348e3e111cf874bb3e9e4de9f3 Mon Sep 17 00:00:00 2001 From: QAston Date: Thu, 30 Jul 2009 14:13:19 +0200 Subject: *Fix exploit with preventing creature enter evade mode. --HG-- branch : trunk --- src/game/Unit.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 8002a5cf078..f48d23bd3dd 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -11406,16 +11406,11 @@ Unit* Creature::SelectVictim() // it in combat but attacker not make any damage and not enter to aggro radius to have record in threat list // for example at owner command to pet attack some far away creature // Note: creature not have targeted movement generator but have attacker in this case - if(m_attackers.size() && CanHaveThreatList() && m_ThreatManager.isThreatListEmpty()) //there are some cases null target are always returned,so creature evade can not be called at all. such as pull creature at a distance beyond the attackdist to the attacker - return NULL; - /*if( GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE ) + for(AttackerSet::const_iterator itr = m_attackers.begin(); itr != m_attackers.end(); ++itr) { - for(AttackerSet::const_iterator itr = m_attackers.begin(); itr != m_attackers.end(); ++itr) - { - if( (*itr)->IsInMap(this) && canAttack(*itr) && (*itr)->isInAccessiblePlaceFor((Creature*)this) ) - return NULL; - } - }*/ + if( (*itr)->IsInMap(this) && canAttack(*itr) && (*itr)->isInAccessiblePlaceFor((Creature*)this) && ((*itr)->GetTypeId() != TYPEID_PLAYER && (!((Creature*)(*itr))->HasSummonMask(SUMMON_MASK_CONTROLABLE_GUARDIAN)))) + return NULL; + } // search nearby enemy before enter evade mode if(HasReactState(REACT_AGGRESSIVE)) -- cgit v1.2.3