[8870] Fix problem with max pet distance from owner.

* Avoid use hardcoded and different max distance from owner for pet (more at contienets and less in instances)
  Use instaed max visibility for map as expected.
* Explicitly pet remove at move pet to non-visible distance for player owner.

Original patch provided by Lightguard.
This commit is contained in:
VladimirMangos 2009-11-24 19:03:48 +03:00
parent e636d63fdb
commit 663038c7c7
5 changed files with 25 additions and 10 deletions

View file

@ -9848,10 +9848,6 @@ bool Unit::isVisibleForOrDetect(Unit const* u, WorldObject const* viewPoint, boo
return false;
}
// always seen by owner
if (GetCharmerOrOwnerGUID()==u->GetGUID())
return true;
// always seen by far sight caster
if (u->GetTypeId()==TYPEID_PLAYER && ((Player*)u)->GetFarSight()==GetGUID())
return true;
@ -9896,6 +9892,10 @@ bool Unit::isVisibleForOrDetect(Unit const* u, WorldObject const* viewPoint, boo
return false;
}
// always seen by owner
if (GetCharmerOrOwnerGUID()==u->GetGUID())
return true;
// isInvisibleForAlive() those units can only be seen by dead or if other
// unit is also invisible for alive.. if an isinvisibleforalive unit dies we
// should be able to see it too