From 65ef38963ddc60e05491ca9d3e2685913c0038bb Mon Sep 17 00:00:00 2001 From: megamage Date: Mon, 22 Dec 2008 10:59:38 -0600 Subject: *The last merge from Mangos TBC. Update to Mangos v0.12. --HG-- branch : trunk --- src/game/MotionMaster.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/game/MotionMaster.cpp') 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(*target,PET_FOLLOW_DIST,PET_FOLLOW_ANGLE)); + } } else { -- cgit v1.2.3