diff --git a/src/game/MotionMaster.cpp b/src/game/MotionMaster.cpp index 2dc42cd..36f49a2 100644 --- a/src/game/MotionMaster.cpp +++ b/src/game/MotionMaster.cpp @@ -150,8 +150,21 @@ 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) + { + sLog.outError("Cannot find owner "I64FMTD, ((Creature*)i_owner)->GetCharmerOrOwnerGUID()); + } + else + { + 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 { diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 5925b21..402d9e6 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -9047,8 +9047,12 @@ bool Unit::CanHaveThreatList() const if( !isAlive() ) return false; - // pets and totems can not have threat list - if( ((Creature*)this)->isPet() || ((Creature*)this)->isTotem() ) + // totems can not have threat list + if( ((Creature*)this)->isTotem() ) + return false; + + // pets can not have a threat list, unless they are controlled by a creature + if( ((Creature*)this)->isPet() && IS_PLAYER_GUID(((Pet*)this)->GetOwnerGUID()) ) return false; return true; diff --git a/win/VC90/game.vcproj b/win/VC90/game.vcproj index e716264..22a25bd 100644 --- a/win/VC90/game.vcproj +++ b/win/VC90/game.vcproj @@ -1,7 +1,7 @@