mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 17:54:48 +01:00
*Some cleanup, change some illogical conditions (if you can attack your target is no reason to ignore the target, o_O)
--HG-- branch : trunk
This commit is contained in:
@@ -2233,7 +2233,7 @@ bool Creature::canCreatureAttack(Unit const *pVictim, bool force) const
|
||||
if(!pVictim->isInAccessiblePlaceFor(this))
|
||||
return false;
|
||||
|
||||
if(!AI()->CanAIAttack(pVictim))
|
||||
if(IsAIEnabled && !AI()->CanAIAttack(pVictim))
|
||||
return false;
|
||||
|
||||
if(sMapStore.LookupEntry(GetMapId())->IsDungeon())
|
||||
|
||||
@@ -11368,7 +11368,7 @@ Unit* Creature::SelectVictim()
|
||||
// Note: creature not have targeted movement generator but have attacker in this case
|
||||
for(AttackerSet::const_iterator itr = m_attackers.begin(); itr != m_attackers.end(); ++itr)
|
||||
{
|
||||
if((*itr) && canCreatureAttack(*itr) && (*itr)->GetTypeId() != TYPEID_PLAYER
|
||||
if((*itr) && !canCreatureAttack(*itr) && (*itr)->GetTypeId() != TYPEID_PLAYER
|
||||
&& !((Creature*)(*itr))->HasUnitTypeMask(UNIT_MASK_CONTROLABLE_GUARDIAN))
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user