aboutsummaryrefslogtreecommitdiff
path: root/src/bindings/scripts
diff options
context:
space:
mode:
authormegamage <none@none>2009-01-28 00:01:52 -0600
committermegamage <none@none>2009-01-28 00:01:52 -0600
commit6de869d8f62464742ea18d34753f1898728d9f53 (patch)
treee53923a24c369ac53885708382714b0fc0fda0d4 /src/bindings/scripts
parentf9754e36309dd37c69109d5966d4be9fdfd902fd (diff)
*Fix the bug that event ai mobs sometimes chase victims even when polymorphed.
--HG-- branch : trunk
Diffstat (limited to 'src/bindings/scripts')
-rw-r--r--src/bindings/scripts/scripts/creature/mob_event_ai.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/bindings/scripts/scripts/creature/mob_event_ai.cpp b/src/bindings/scripts/scripts/creature/mob_event_ai.cpp
index eee4269e12c..6b46b7aecde 100644
--- a/src/bindings/scripts/scripts/creature/mob_event_ai.cpp
+++ b/src/bindings/scripts/scripts/creature/mob_event_ai.cpp
@@ -1225,7 +1225,7 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
//Check if we are in combat (also updates calls threat update code)
- bool Combat = InCombat ? (m_creature->SelectHostilTarget() && m_creature->getVictim()) : false;
+ bool Combat = InCombat ? m_creature->SelectHostilTarget() : false;
//Must return if creature isn't alive. Normally select hostil target and get victim prevent this
if (!m_creature->isAlive())
@@ -1233,11 +1233,9 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
if (IsFleeing)
{
- if(TimetoFleeLeft < diff
- || m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE
- && m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != FLEEING_MOTION_TYPE)
+ if(TimetoFleeLeft < diff)
{
- m_creature->GetMotionMaster()->Clear(false);
+ m_creature->SetControlled(false, UNIT_STAT_FLEEING);
m_creature->SetNoCallAssistance(false);
m_creature->CallAssistance();
if(m_creature->getVictim())