mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 10:26:28 +01:00
*Fix the crash bug of waypoint movement.
--HG-- branch : trunk
This commit is contained in:
@@ -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<>
|
||||
|
||||
@@ -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 &);
|
||||
|
||||
Reference in New Issue
Block a user