aboutsummaryrefslogtreecommitdiff
path: root/src/bindings/scripts
diff options
context:
space:
mode:
authorgvcoman <none@none>2008-11-22 16:55:17 -0500
committergvcoman <none@none>2008-11-22 16:55:17 -0500
commit915bc1acdac918f6a1c3017527e072652f59a613 (patch)
treec45fe9418b6dd7fe2dc0a6d1c2c79094635cb74b /src/bindings/scripts
parentbd5ee9e49ef2fa0e6503887f314e6d515505140e (diff)
Make summoned creatures go back to summoner on evade if summoner is alive. This should take care of most (all?) errors about controlled creatures trying to target home.
--HG-- branch : trunk
Diffstat (limited to 'src/bindings/scripts')
-rw-r--r--src/bindings/scripts/scripts/creature/mob_event_ai.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/bindings/scripts/scripts/creature/mob_event_ai.cpp b/src/bindings/scripts/scripts/creature/mob_event_ai.cpp
index 289b6b925c5..657a1f41b5b 100644
--- a/src/bindings/scripts/scripts/creature/mob_event_ai.cpp
+++ b/src/bindings/scripts/scripts/creature/mob_event_ai.cpp
@@ -1038,7 +1038,15 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
m_creature->CombatStop();
m_creature->LoadCreaturesAddon();
if( m_creature->isAlive() )
- m_creature->GetMotionMaster()->MoveTargetedHome();
+ {
+ if (Unit* owner = m_creature->GetOwner())
+ {
+ if (owner->isAlive())
+ m_creature->GetMotionMaster()->MoveFollow(owner,PET_FOLLOW_DIST,PET_FOLLOW_ANGLE);
+ }
+ else
+ m_creature->GetMotionMaster()->MoveTargetedHome();
+ }
m_creature->SetLootRecipient(NULL);