From 0ba9b3fedc270937e55c13d0472bff36ab7091f0 Mon Sep 17 00:00:00 2001 From: KimLS Date: Tue, 29 Aug 2017 22:03:22 -0700 Subject: [PATCH] Fix for bug in pathing stuck detection --- zone/pathing.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/zone/pathing.cpp b/zone/pathing.cpp index e805138e3..9bd6492a7 100644 --- a/zone/pathing.cpp +++ b/zone/pathing.cpp @@ -77,19 +77,18 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa bool AtPrevNode = DistanceSquared(From, PathingLastPosition) < 1.0f; if (AtPrevNode) { PathingLoopCount++; + auto front = (*Route.begin()).pos; if (PathingLoopCount > 5) { + Teleport(front); SendPosition(); + Route.pop_front(); + + WaypointChanged = true; + NodeReached = true; + PathingLoopCount = 0; } - auto front = (*Route.begin()).pos; - Teleport(front); - Route.pop_front(); - - WaypointChanged = true; - NodeReached = true; - PathingLoopCount = 0; - return front; } else {