diff options
author | gvcoman <none@none> | 2008-11-22 16:55:17 -0500 |
---|---|---|
committer | gvcoman <none@none> | 2008-11-22 16:55:17 -0500 |
commit | 915bc1acdac918f6a1c3017527e072652f59a613 (patch) | |
tree | c45fe9418b6dd7fe2dc0a6d1c2c79094635cb74b /src/game/ReactorAI.cpp | |
parent | bd5ee9e49ef2fa0e6503887f314e6d515505140e (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/game/ReactorAI.cpp')
-rw-r--r-- | src/game/ReactorAI.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/game/ReactorAI.cpp b/src/game/ReactorAI.cpp index 41e5fb51f10..de8f544fddb 100644 --- a/src/game/ReactorAI.cpp +++ b/src/game/ReactorAI.cpp @@ -123,7 +123,12 @@ ReactorAI::EnterEvadeMode() i_creature.CombatStop(); i_creature.SetLootRecipient(NULL); - // Remove TargetedMovementGenerator from MotionMaster stack list, and add HomeMovementGenerator instead - if( i_creature.GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE ) - i_creature.GetMotionMaster()->MoveTargetedHome(); + if(!i_creature.GetCharmerOrOwner()) + { + // Remove TargetedMovementGenerator from MotionMaster stack list, and add HomeMovementGenerator instead + if( i_creature.GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE ) + i_creature.GetMotionMaster()->MoveTargetedHome(); + } + else if (i_creature.GetOwner() && i_creature.GetOwner()->isAlive()) + i_creature.GetMotionMaster()->MoveFollow(owner,PET_FOLLOW_DIST,PET_FOLLOW_ANGLE); } |