diff options
author | TrullyONE <none@none> | 2008-12-24 12:06:25 +0200 |
---|---|---|
committer | TrullyONE <none@none> | 2008-12-24 12:06:25 +0200 |
commit | 08fa019253895c97515a6324a19b9183d5a39ce5 (patch) | |
tree | 5a78451495291252236c963366ca71208379cb75 /src/game/WaypointMovementGenerator.cpp | |
parent | c81299e6536e249ca05eebf100f3f350522da7da (diff) |
*Additional movement checks added.
--HG--
branch : trunk
Diffstat (limited to 'src/game/WaypointMovementGenerator.cpp')
-rw-r--r-- | src/game/WaypointMovementGenerator.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp index 71d05d073d2..85ef44b51be 100644 --- a/src/game/WaypointMovementGenerator.cpp +++ b/src/game/WaypointMovementGenerator.cpp @@ -15,24 +15,17 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -//Basic header -#include <ctime> - +//Basic headers #include "WaypointMovementGenerator.h" #include "DestinationHolderImp.h" -//Accessors -#include "Database/DatabaseEnv.h" +//Extended headers #include "ObjectMgr.h" #include "World.h" //Creature-specific headers #include "Creature.h" #include "CreatureAI.h" -//Player-Specific +//Player-specific #include "Player.h" -//Visual -#include "ProgressBar.h" -#include "MapManager.h" template<class T> void @@ -42,6 +35,8 @@ template<> void WaypointMovementGenerator<Creature>::Initialize(Creature &u) { + u.StopMoving(); + i_nextMoveTime.Reset(0); i_currentNode = -1; if(!path_id) path_id = u.GetWaypointPath(); @@ -160,6 +155,7 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff) i_currentNode = 0; //Start moving all over again else { + unit.SetHomePosition(node.x, node.y, node.z, unit.GetOrientation()); unit.GetMotionMaster()->Initialize(); return false; //Clear the waypoint movement } @@ -184,6 +180,7 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff) MovementInform(unit); unit.UpdateWaypointID(i_currentNode); unit.clearUnitState(UNIT_STAT_MOVING); + unit.Relocate(node.x, node.y, node.z); } } else |