diff --git a/zone/fearpath.cpp b/zone/fearpath.cpp index 4d39717b5..c2ce95fbe 100644 --- a/zone/fearpath.cpp +++ b/zone/fearpath.cpp @@ -154,7 +154,8 @@ void Mob::CalculateNewFearpoint() int loop = 0; float ranx, rany, ranz; - currently_fleeing = false; + + currently_fleeing = true; while (loop < 100) //Max 100 tries { int ran = 250 - (loop*2); @@ -167,11 +168,13 @@ void Mob::CalculateNewFearpoint() float fdist = ranz - GetZ(); if (fdist >= -12 && fdist <= 12 && CheckCoordLosNoZLeaps(GetX(),GetY(),GetZ(),ranx,rany,ranz)) { - currently_fleeing = true; break; } } - if (currently_fleeing) - m_FearWalkTarget = glm::vec3(ranx, rany, ranz); + + if (loop <= 100) + { + m_FearWalkTarget = glm::vec3(ranx, rany, ranz); + } } diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index c56f0daaf..8eb838a72 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -495,7 +495,8 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, int speed, boo m_Position.y = new_y; m_Position.z = new_z; - if(fix_z_timer.Check() && !this->IsEngaged()) + if(fix_z_timer.Check() && + (!this->IsEngaged() || flee_mode || currently_fleeing)) this->FixZ(); tar_ndx++; @@ -1129,4 +1130,4 @@ void NPC::SaveGuardSpotCharm() void NPC::RestoreGuardSpotCharm() { m_GuardPoint = m_GuardPointSaved; -} \ No newline at end of file +}