From 03bc245318ad9b5ed9d1c8c60463320dc7c13abf Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Fri, 5 Jun 2015 21:30:35 -0400 Subject: [PATCH] Fix fleeing when zones have map files --- zone/pathing.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/zone/pathing.cpp b/zone/pathing.cpp index 8224f3692..32a55d73a 100644 --- a/zone/pathing.cpp +++ b/zone/pathing.cpp @@ -16,7 +16,7 @@ #define snprintf _snprintf #endif -//#define PATHDEBUG +//#define PATHDEBUG extern Zone *zone; @@ -205,10 +205,10 @@ glm::vec3 PathManager::GetPathNodeCoordinates(int NodeNumber, bool BestZ) } std::deque PathManager::FindRoute(int startID, int endID) -{ +{ Log.Out(Logs::Detail, Logs::None, "FindRoute from node %i to %i", startID, endID); - memset(ClosedListFlag, 0, sizeof(int) * Head.PathNodeCount); + memset(ClosedListFlag, 0, sizeof(int) * Head.PathNodeCount); std::deque OpenList, ClosedList; @@ -665,6 +665,9 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa bool SameDestination = (To == PathingDestination); + if (Speed <= 0) // our speed is 0, we cant move so lets return the dest + return To; // this will also avoid the teleports cleanly + int NextNode; if(To == From)