[10482] Add basic function MoveWaypoint() to manually start creature waypoint path

Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
NoFantasy 2010-09-14 12:42:36 +02:00
parent 3027d4ba61
commit 921dda56ba
3 changed files with 23 additions and 1 deletions

View file

@ -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>(*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)

View file

@ -104,6 +104,7 @@ class MANGOS_DLL_SPEC MotionMaster : private std::stack<MovementGenerator *>
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);

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10481"
#define REVISION_NR "10482"
#endif // __REVISION_NR_H__