diff options
author | MeanMachine@MeanMachine-PC <none@none> | 2008-12-10 06:34:35 +0200 |
---|---|---|
committer | MeanMachine@MeanMachine-PC <none@none> | 2008-12-10 06:34:35 +0200 |
commit | cc0838459a86e45ccdbaa4977e20f4233f1ff1c1 (patch) | |
tree | 04e80e4c678250c4d40e25d4f2e07f1886d06fe9 /src/game/MotionMaster.cpp | |
parent | b5d1418b0cdd38980ec1fec3af1ddf031c9cb9e5 (diff) |
Featuring a rewritten waypoint movement with more options, optimised code and revamped ingame waypoint control. To convert entries from the old tables manually, please use the PHP script provided at http://www.trinitycore.org/forum/project.php?issueid=830
--HG--
branch : trunk
Diffstat (limited to 'src/game/MotionMaster.cpp')
-rw-r--r-- | src/game/MotionMaster.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/game/MotionMaster.cpp b/src/game/MotionMaster.cpp index d3167e180a0..9050c95b651 100644 --- a/src/game/MotionMaster.cpp +++ b/src/game/MotionMaster.cpp @@ -319,6 +319,31 @@ void MotionMaster::Mutate(MovementGenerator *m) push(m); } +void MotionMaster::MovePath(uint32 path_id, bool repeatable)
+{
+ if(!path_id)
+ return;
+ //We set waypoint movement as new default movement generator
+ // clear ALL movement generators (including default)
+ while(!empty())
+ {
+ MovementGenerator *curr = top();
+ curr->Finalize(*i_owner);
+ pop();
+ if( !isStatic( curr ) )
+ delete curr;
+ }
+
+ sLog.outError("attempting to move");
+ //i_owner->GetTypeId()==TYPEID_PLAYER ?
+ //Mutate(new WaypointMovementGenerator<Player>(path_id, repeatable)):
+ Mutate(new WaypointMovementGenerator<Creature>(path_id, repeatable));
+
+ DEBUG_LOG("%s (GUID: %u) start moving over path(Id:%u, repeatable: %s)",
+ i_owner->GetTypeId()==TYPEID_PLAYER ? "Player" : "Creature",
+ i_owner->GetGUIDLow(), path_id, repeatable ? "YES" : "NO" );
+}
+ void MotionMaster::propagateSpeedChange() { Impl::container_type::iterator it = Impl::c.begin(); |