Fix problem with max pet distance from owner. by VladimirMangos

--HG--
branch : trunk
This commit is contained in:
n0n4m3
2009-12-19 20:02:38 +01:00
parent acc95b66c9
commit 1c0f2d233f
3 changed files with 22 additions and 7 deletions

View File

@@ -514,8 +514,8 @@ void Pet::Update(uint32 diff)
{
// unsummon pet that lost owner
Player* owner = GetOwner();
if(!owner || (!IsWithinDistInMap(owner, OWNER_MAX_DISTANCE) && !isPossessed()) || isControlled() && !owner->GetPetGUID())
//if(!owner || (!IsWithinDistInMap(owner, OWNER_MAX_DISTANCE) && (owner->GetCharmGUID() && (owner->GetCharmGUID() != GetGUID()))) || (isControlled() && !owner->GetPetGUID()))
if(!owner || (!IsWithinDistInMap(owner, GetMap()->GetVisibilityDistance()) && !isPossessed()) || isControlled() && !owner->GetPetGUID())
//if(!owner || (!IsWithinDistInMap(owner, GetMap()->GetVisibilityDistance()) && (owner->GetCharmGUID() && (owner->GetCharmGUID() != GetGUID()))) || (isControlled() && !owner->GetPetGUID()))
{
Remove(PET_SAVE_NOT_IN_SLOT, true);
return;