diff options
-rw-r--r-- | src/game/WaypointMovementGenerator.cpp | 14 | ||||
-rw-r--r-- | src/game/WaypointMovementGenerator.h | 2 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp index c4025d9de5e..b44c44aaff7 100644 --- a/src/game/WaypointMovementGenerator.cpp +++ b/src/game/WaypointMovementGenerator.cpp @@ -95,21 +95,23 @@ void WaypointMovementGenerator<Creature>::Initialize(Creature &u) { u.StopMoving(); - i_currentNode = -1; // uint32, become 0 in the first update - i_nextMoveTime.Reset(0); + //i_currentNode = -1; // uint32, become 0 in the first update + //i_nextMoveTime.Reset(0); StopedByPlayer = false; if(!path_id) path_id = u.GetWaypointPath(); waypoints = WaypointMgr.GetPath(path_id); - /*i_currentNode = 0; + i_currentNode = 0; if(waypoints && waypoints->size()) { + node = waypoints->front(); Traveller<Creature> traveller(u); - node = *(waypoints->at(i_currentNode)); - InitTraveller(u,node); + InitTraveller(u, *node); i_destinationHolder.SetDestination(traveller, node->x, node->y, node->z); i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime()); - }*/ + } + else + node = NULL; } template<> diff --git a/src/game/WaypointMovementGenerator.h b/src/game/WaypointMovementGenerator.h index 899c55a5925..e9c806a4f7d 100644 --- a/src/game/WaypointMovementGenerator.h +++ b/src/game/WaypointMovementGenerator.h @@ -67,7 +67,7 @@ class TRINITY_DLL_SPEC WaypointMovementGenerator { public: WaypointMovementGenerator(uint32 _path_id = 0, bool _repeating = true) : - i_nextMoveTime(0), path_id(_path_id), repeating(_repeating), StopedByPlayer(false){} + i_nextMoveTime(0), path_id(_path_id), repeating(_repeating), StopedByPlayer(false), node(NULL) {} void Initialize(T &); void Finalize(T &); |