aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormaximius <none@none>2009-10-13 19:48:35 -0700
committermaximius <none@none>2009-10-13 19:48:35 -0700
commite490c33725c670e0a43718fbc9dc7e3ac69fb3aa (patch)
treec98d5cb3d51b5fa3e8b517436dcd2c80659ad769 /src
parentc6b940a078379c9c258ed04eb50b200df9194e8e (diff)
*Some cleanup, change some illogical conditions (if you can attack your target is no reason to ignore the target, o_O)
--HG-- branch : trunk
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;
}