diff options
| author | megamage <none@none> | 2008-12-26 16:27:41 -0600 |
|---|---|---|
| committer | megamage <none@none> | 2008-12-26 16:27:41 -0600 |
| commit | 7346ed5951822d5b8f61817ff1ad95d2c4e2cd73 (patch) | |
| tree | 3a6c59366f445379b9709df26afd05173eed1531 /src/game/WaypointMovementGenerator.cpp | |
| parent | 8d79395783e6dfb59777ce5fcedf722a99580765 (diff) | |
| parent | 07e2410ed830a620a0749e4039e0e544278267d7 (diff) | |
*Merge to Trinity 673.
--HG--
branch : trunk
Diffstat (limited to 'src/game/WaypointMovementGenerator.cpp')
| -rw-r--r-- | src/game/WaypointMovementGenerator.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp index 85ef44b51be..67c56d763bc 100644 --- a/src/game/WaypointMovementGenerator.cpp +++ b/src/game/WaypointMovementGenerator.cpp @@ -36,11 +36,17 @@ void WaypointMovementGenerator<Creature>::Initialize(Creature &u) { u.StopMoving(); - i_nextMoveTime.Reset(0); - i_currentNode = -1; if(!path_id) path_id = u.GetWaypointPath(); - waypoints = WaypointMgr.GetPath(path_id); + waypoints = WaypointMgr.GetPath(path_id); + if(waypoints && waypoints->size()) + { + Traveller<Creature> traveller(unit); + node = *(waypoints->at(i_currentNode)); + InitTraveller(u,node); + i_destinationHolder.SetDestination(traveller, node.x, node.y, node.z); + i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime()); + } } template<> |
