From 477ba707820e266d3e4795c1396d692482590a6c Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Wed, 10 Dec 2008 18:06:37 +0300 Subject: [PATCH] [6893] Fixes in waypoint movement code. Initilize variables and reset last movment timer for correct waypoints work at reset movement. --- src/game/WaypointMovementGenerator.h | 14 ++++++++++---- src/shared/revision_nr.h | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/game/WaypointMovementGenerator.h b/src/game/WaypointMovementGenerator.h index bcd14d893..d6cb21752 100644 --- a/src/game/WaypointMovementGenerator.h +++ b/src/game/WaypointMovementGenerator.h @@ -73,10 +73,8 @@ class MANGOS_DLL_SPEC WaypointMovementGenerator : public MovementGeneratorMedium< Creature, WaypointMovementGenerator >, public PathMovementBase { - TimeTrackerSmall i_nextMoveTime; - std::vector i_hasDone; public: - WaypointMovementGenerator(Creature &) : i_nextMoveTime(0) {} + WaypointMovementGenerator(Creature &) : i_nextMoveTime(0), b_StopedByPlayer(false) {} ~WaypointMovementGenerator() { ClearWaypoints(); } void Initialize(Creature &u) { @@ -85,7 +83,12 @@ public PathMovementBase LoadPath(u); } void Finalize(Creature &) {} - void Reset(Creature &u) { ReloadPath(u); } + void Reset(Creature &u) + { + ReloadPath(u); + b_StopedByPlayer = false; + i_nextMoveTime.Reset(0); + } bool Update(Creature &u, const uint32 &diff); void MovementInform(Creature &); @@ -104,6 +107,9 @@ public PathMovementBase static void Initialize(void); private: void ClearWaypoints(); + + TimeTrackerSmall i_nextMoveTime; + std::vector i_hasDone; bool b_StopedByPlayer; }; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index ae4d0945a..783240f02 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "6892" + #define REVISION_NR "6893" #endif // __REVISION_NR_H__