[9568] Add function to manually start random movement.

Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
NoFantasy 2010-03-11 00:46:40 +01:00
parent 8ffeb2b48b
commit 45cc830eae
3 changed files with 16 additions and 1 deletions

View file

@ -28,6 +28,7 @@
#include "PointMovementGenerator.h"
#include "TargetedMovementGenerator.h"
#include "WaypointMovementGenerator.h"
#include "RandomMovementGenerator.h"
#include <cassert>
@ -209,6 +210,19 @@ void MotionMaster::MoveIdle()
push(&si_idleMovement);
}
void MotionMaster::MoveRandom()
{
if (i_owner->GetTypeId() == TYPEID_PLAYER)
{
sLog.outError("Player (GUID: %u) attempt to move random.", i_owner->GetGUIDLow());
}
else
{
DEBUG_LOG("Creature (Entry: %u GUID: %u) move random.", i_owner->GetEntry(), i_owner->GetGUIDLow());
Mutate(new RandomMovementGenerator<Creature>(*i_owner));
}
}
void
MotionMaster::MoveTargetedHome()
{

View file

@ -95,6 +95,7 @@ class MANGOS_DLL_SPEC MotionMaster : private std::stack<MovementGenerator *>
}
void MoveIdle();
void MoveRandom();
void MoveTargetedHome();
void MoveFollow(Unit* target, float dist, float angle);
void MoveChase(Unit* target, float dist = 0.0f, float angle = 0.0f);

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9567"
#define REVISION_NR "9568"
#endif // __REVISION_NR_H__