aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
authormaximius <none@none>2009-09-17 01:26:54 -0700
committermaximius <none@none>2009-09-17 01:26:54 -0700
commit5b8ee23e4751f72fd9ccb42e51332f6cdf8754e7 (patch)
tree44a9ae6c1105fd09c4ff41fe338b43efbf4963c1 /src/game/Unit.cpp
parent3e7c851aaeebdd43211700f2902e4455586b677c (diff)
parent1be0e825ce36c72209242e6b14dc86e3a7e972a7 (diff)
*Better fix to the waypoint mobs returning to spawn issue, thanks XTElite1
--HG-- branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index c6fd2e5c270..d37aa91373a 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -10528,9 +10528,9 @@ void Unit::SetInCombatState(bool PvP, Unit* enemy)
if(GetTypeId() != TYPEID_PLAYER)
{
// Set home position at place of engaging combat for escorted creatures
- //if(((Creature*)this)->IsAIEnabled)
- //if (((Creature *)this)->AI()->IsEscorted())
- ((Creature*)this)->SetHomePosition(GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
+ if((((Creature*)this)->IsAIEnabled && ((Creature*)this)->AI()->IsEscorted()) || ((Creature*)this)->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
+ ((Creature*)this)->SetHomePosition(GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
+
if(enemy)
{
if(((Creature*)this)->IsAIEnabled)