diff options
author | megamage <none@none> | 2008-12-31 10:46:43 -0600 |
---|---|---|
committer | megamage <none@none> | 2008-12-31 10:46:43 -0600 |
commit | 8a9a9f88cc67f22a4f06463df01d7681fd9c81ff (patch) | |
tree | 8d9a74528614c7d8a9446b0ddf8fdcdc9b7af6e5 /src/game/WaypointMovementGenerator.cpp | |
parent | 3885ce94d9be86616bb01e660a70087fcbfc6ffd (diff) |
*Fix the crash bug of waypoint movement.
--HG--
branch : trunk
Diffstat (limited to 'src/game/WaypointMovementGenerator.cpp')
-rw-r--r-- | src/game/WaypointMovementGenerator.cpp | 14 |
1 files changed, 8 insertions, 6 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<> |