*Add some distance check functions. By VladimirMangos.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-05-14 16:50:47 -05:00
parent 811eee356d
commit 047cc95388
17 changed files with 364 additions and 61 deletions

View File

@@ -1673,7 +1673,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
if (!(options & TELE_TO_NOT_UNSUMMON_PET))
{
//same map, only remove pet if out of range for new position
if(pet && pet->GetDistance(x,y,z) >= OWNER_MAX_DISTANCE)
if(pet && !pet->IsWithinDist3d(x,y,z, OWNER_MAX_DISTANCE))
UnsummonPetTemporaryIfAny();
}