From b0a3e9205fa1268f9cbe58ab16f269c0bf959b44 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 21 Aug 2017 02:42:50 -0500 Subject: [PATCH] [FixZ] Smooth out close combat npc/pet hopping --- zone/mob_ai.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index 14e9337ac..ef82527f9 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -1001,10 +1001,9 @@ void Mob::AI_Process() { if (this->GetTarget()) { /* If we are engaged, moving and following client, let's look for best Z more often */ float target_distance = DistanceNoZ(this->GetPosition(), this->GetTarget()->GetPosition()); - if (target_distance >= 25) { - this->FixZ(); - } - else if (!this->CheckLosFN(this->GetTarget())) { + this->FixZ(); + + if (target_distance <= 15 && !this->CheckLosFN(this->GetTarget())) { Mob* target = this->GetTarget(); m_Position.x = target->GetX();