diff options
author | megamage <none@none> | 2008-12-24 10:58:07 -0600 |
---|---|---|
committer | megamage <none@none> | 2008-12-24 10:58:07 -0600 |
commit | 5b2636c35474cd366348eae5dcfe3f333931d02e (patch) | |
tree | d2cae0b666a3385b337c587f72c70ff5e42c291e /src/game/WaypointMovementGenerator.cpp | |
parent | 253f4bf374ccaa83d20a7ff58e31b37300f4a26e (diff) | |
parent | 12a52d2fbb3aef60f7eff73d1a10e0dbe9de5edf (diff) |
*Merge.
--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 |