crash fix

This commit is contained in:
tomrus88 2008-11-16 17:04:27 +03:00
parent 681cc6ecf4
commit 4e76f1ac98
7 changed files with 32 additions and 20 deletions

View file

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