Fix for bug in pathing stuck detection

This commit is contained in:
KimLS 2017-08-29 22:03:22 -07:00
parent 46561b9cf5
commit 0ba9b3fedc

View File

@ -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; bool AtPrevNode = DistanceSquared(From, PathingLastPosition) < 1.0f;
if (AtPrevNode) { if (AtPrevNode) {
PathingLoopCount++; PathingLoopCount++;
auto front = (*Route.begin()).pos;
if (PathingLoopCount > 5) { if (PathingLoopCount > 5) {
Teleport(front);
SendPosition(); 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; return front;
} }
else { else {