I'm currently using
if (IsTame())
{
if (m_OwnerName != "" && m_OwnerObject == NULL)
{
class cCallback :
public cPlayerListCallback
{
virtual bool Item(cPlayer * Player) override
{
OwnerObject = Player;
return false;
}
public:
cPlayer * OwnerObject;
} Callback;
m_World->DoWithPlayer(m_OwnerName, Callback);
if (Callback.OwnerObject != NULL)
{
m_OwnerObject = Callback.OwnerObject;
m_OwnerName = m_OwnerObject->GetName();
}
}
else
{
if (m_OwnerObject->IsDestroyed())
{
m_OwnerObject = NULL;
return;
}
Vector3f OwnerCoords = Vector3f(m_OwnerObject->GetPosition());
double Distance = (OwnerCoords - GetPosition()).Length();
if (Distance < 3)
{
m_bMovingToDestination = false;
}
else if ((Distance > 30) && (!IsSitting()))
{
TeleportToCoords(OwnerCoords.x, OwnerCoords.y, OwnerCoords.z);
}
else
{
m_Destination = OwnerCoords;
}
}
}
This should fix it right?

