mirror of
https://github.com/EQEmu/Server.git
synced 2026-01-04 19:53:52 +00:00
Pets should warp to owner >= 450 units Fixes #715
This commit is contained in:
parent
ca0b9bc374
commit
959337b592
@ -918,29 +918,26 @@ void Client::AI_Process()
|
||||
}
|
||||
}
|
||||
|
||||
if(IsPet())
|
||||
{
|
||||
Mob* owner = GetOwner();
|
||||
if(owner == nullptr)
|
||||
if (IsPet()) {
|
||||
Mob *owner = GetOwner();
|
||||
if (owner == nullptr)
|
||||
return;
|
||||
|
||||
float dist = DistanceSquared(m_Position, owner->GetPosition());
|
||||
if (dist >= 400)
|
||||
{
|
||||
if(AI_movement_timer->Check())
|
||||
{
|
||||
int nspeed = (dist >= 5625 ? GetRunspeed() : GetWalkspeed());
|
||||
if (dist >= 202500) { // >= 450 distance
|
||||
Teleport(static_cast<glm::vec3>(owner->GetPosition()));
|
||||
SendPositionUpdate(); // this shouldn't happen a lot (and hard to make it) so lets not rate limit
|
||||
} else if (dist >= 400) { // >=20
|
||||
if (AI_movement_timer->Check()) {
|
||||
int nspeed = (dist >= 5625 ? GetRunspeed() : GetWalkspeed()); // >= 75
|
||||
animation = nspeed;
|
||||
nspeed *= 2;
|
||||
SetCurrentSpeed(nspeed);
|
||||
|
||||
CalculateNewPosition2(owner->GetX(), owner->GetY(), owner->GetZ(), nspeed);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(moved)
|
||||
{
|
||||
} else {
|
||||
if (moved) {
|
||||
SetCurrentSpeed(0);
|
||||
moved = false;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user