aboutsummaryrefslogtreecommitdiff
path: root/src/game/MotionMaster.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2008-12-22 10:59:38 -0600
committermegamage <none@none>2008-12-22 10:59:38 -0600
commit65ef38963ddc60e05491ca9d3e2685913c0038bb (patch)
tree740f287e537982028ac4b0974d4a88aeae9075d8 /src/game/MotionMaster.cpp
parentf7dd2df7955f5c5d17ee2ad27fb6c9a0f89d7196 (diff)
*The last merge from Mangos TBC. Update to Mangos v0.12.
--HG-- branch : trunk
Diffstat (limited to 'src/game/MotionMaster.cpp')
-rw-r--r--src/game/MotionMaster.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/game/MotionMaster.cpp b/src/game/MotionMaster.cpp
index 4b667ad9ccd..36bdbbb3a01 100644
--- a/src/game/MotionMaster.cpp
+++ b/src/game/MotionMaster.cpp
@@ -163,8 +163,17 @@ MotionMaster::MoveTargetedHome()
}
else if(i_owner->GetTypeId()==TYPEID_UNIT && ((Creature*)i_owner)->GetCharmerOrOwnerGUID())
{
- sLog.outError("Pet or controlled creature (Entry: %u GUID: %u) attempt targeted home",
+ DEBUG_LOG("Pet or controlled creature (Entry: %u GUID: %u) targeting home",
i_owner->GetEntry(), i_owner->GetGUIDLow() );
+ Unit *target = ((Creature*)i_owner)->GetCharmerOrOwner();
+ if(target)
+ {
+ i_owner->addUnitState(UNIT_STAT_FOLLOW);
+ DEBUG_LOG("Following %s (GUID: %u)",
+ target->GetTypeId()==TYPEID_PLAYER ? "player" : "creature",
+ target->GetTypeId()==TYPEID_PLAYER ? target->GetGUIDLow() : ((Creature*)target)->GetDBTableGUIDLow() );
+ Mutate(new TargetedMovementGenerator<Creature>(*target,PET_FOLLOW_DIST,PET_FOLLOW_ANGLE));
+ }
}
else
{