mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-12 08:02:25 +00:00
This patches gross pet errors in Z.
This commit is contained in:
parent
1471784035
commit
fb2f8327e2
@ -1391,19 +1391,33 @@ void Mob::AI_Process() {
|
|||||||
//if(owner->IsClient())
|
//if(owner->IsClient())
|
||||||
// printf("Pet start pos: (%f, %f, %f)\n", GetX(), GetY(), GetZ());
|
// printf("Pet start pos: (%f, %f, %f)\n", GetX(), GetY(), GetZ());
|
||||||
|
|
||||||
float dist = DistanceSquared(m_Position, owner->GetPosition());
|
glm::vec4 ownerPos = owner->GetPosition();
|
||||||
if (dist >= 400)
|
float dist = DistanceSquared(m_Position, ownerPos);
|
||||||
|
float distz = ownerPos.z - m_Position.z;
|
||||||
|
|
||||||
|
if (dist >= 400 || distz > 100)
|
||||||
{
|
{
|
||||||
int speed = GetWalkspeed();
|
int speed = GetWalkspeed();
|
||||||
if (dist >= 5625)
|
if (dist >= 5625)
|
||||||
speed = GetRunspeed();
|
speed = GetRunspeed();
|
||||||
|
|
||||||
CalculateNewPosition2(owner->GetX(), owner->GetY(), owner->GetZ(), speed);
|
if (distz > 100)
|
||||||
|
{
|
||||||
|
m_Position = ownerPos;
|
||||||
|
SendPositionUpdate();
|
||||||
|
moved = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CalculateNewPosition2(owner->GetX(),
|
||||||
|
owner->GetY(), owner->GetZ(), speed);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(moved)
|
if(moved)
|
||||||
{
|
{
|
||||||
|
this->FixZ();
|
||||||
SetCurrentSpeed(0);
|
SetCurrentSpeed(0);
|
||||||
moved = false;
|
moved = false;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user