aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/Unit.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index c40f37ec48f..2e855283cfe 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -10333,6 +10333,8 @@ bool Unit::SelectHostilTarget()
{
target = m_ThreatManager.getHostilTarget();
}
+ else
+ target = getVictim();
}
if(target)
@@ -10344,7 +10346,7 @@ bool Unit::SelectHostilTarget()
}
// no target but something prevent go to evade mode
- if( !isInCombat() || HasAuraType(SPELL_AURA_MOD_TAUNT) )
+ if( !isInCombat() /*|| HasAuraType(SPELL_AURA_MOD_TAUNT)*/ )
return false;
// last case when creature don't must go to evade mode:
@@ -10367,6 +10369,18 @@ bool Unit::SelectHostilTarget()
return true;
}
+ if(m_invisibilityMask)
+ {
+ Unit::AuraList const& iAuras = GetAurasByType(SPELL_AURA_MOD_INVISIBILITY);
+ for(Unit::AuraList::const_iterator itr = iAuras.begin(); itr != iAuras.end(); ++itr)
+ if((*itr)->IsPermanent())
+ {
+ ((Creature*)this)->AI()->EnterEvadeMode();
+ break;
+ }
+ return false;
+ }
+
// enter in evade mode in other case
((Creature*)this)->AI()->EnterEvadeMode();