mirror of
https://github.com/mangosfour/server.git
synced 2025-12-20 07:37:02 +00:00
[10482] Add basic function MoveWaypoint() to manually start creature waypoint path
Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
parent
3027d4ba61
commit
921dda56ba
3 changed files with 23 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "10481"
|
||||
#define REVISION_NR "10482"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue