diff options
author | megamage <none@none> | 2008-12-09 23:06:16 -0600 |
---|---|---|
committer | megamage <none@none> | 2008-12-09 23:06:16 -0600 |
commit | ebf6469fb4347c2065da9d32992c38c812a05e08 (patch) | |
tree | 0a91e241ef2a4add4a2a44d3544844e013bca371 /src/game/MotionMaster.cpp | |
parent | 36af87fc72594b3b6e3b91e91cd29a00e1a36480 (diff) | |
parent | cc0838459a86e45ccdbaa4977e20f4233f1ff1c1 (diff) |
*Merge to solve EOL issue.
--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..0195e3ebdf6 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(); |