aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/Creature.cpp2
-rw-r--r--src/game/Unit.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp
index 3f461599f60..3489260eb84 100644
--- a/src/game/Creature.cpp
+++ b/src/game/Creature.cpp
@@ -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())
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 151ae917c82..af70169ee39 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -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;
}