diff --git a/src/game/MotionMaster.cpp b/src/game/MotionMaster.cpp index 8f2ba5adc..37df11753 100644 --- a/src/game/MotionMaster.cpp +++ b/src/game/MotionMaster.cpp @@ -352,6 +352,27 @@ void MotionMaster::MoveFleeing(Unit* enemy, uint32 time) } } +void MotionMaster::MoveWaypoint() +{ + if (m_owner->GetTypeId() == TYPEID_UNIT) + { + if (GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE) + { + sLog.outError("Creature %s (Entry %u) attempt to MoveWaypoint() but creature is already using waypoint", m_owner->GetObjectGuid().GetString().c_str(), m_owner->GetEntry()); + return; + } + + Creature* creature = (Creature*)m_owner; + + DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "Creature %s (Entry %u) start MoveWaypoint()", m_owner->GetObjectGuid().GetString().c_str(), m_owner->GetEntry()); + Mutate(new WaypointMovementGenerator(*creature)); + } + else + { + sLog.outError("Non-creature %s attempt to MoveWaypoint()", m_owner->GetObjectGuid().GetString().c_str()); + } +} + void MotionMaster::MoveTaxiFlight(uint32 path, uint32 pathnode) { if (m_owner->GetTypeId() == TYPEID_PLAYER) diff --git a/src/game/MotionMaster.h b/src/game/MotionMaster.h index d67f27cc2..605fdffd0 100644 --- a/src/game/MotionMaster.h +++ b/src/game/MotionMaster.h @@ -104,6 +104,7 @@ class MANGOS_DLL_SPEC MotionMaster : private std::stack void MovePoint(uint32 id, float x,float y,float z); void MoveSeekAssistance(float x,float y,float z); void MoveSeekAssistanceDistract(uint32 timer); + void MoveWaypoint(); void MoveTaxiFlight(uint32 path, uint32 pathnode); void MoveDistract(uint32 timeLimit); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 406838807..3c2694fb0 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 "10481" + #define REVISION_NR "10482" #endif // __REVISION_NR_H__