aboutsummaryrefslogtreecommitdiff
path: root/src/game/MotionMaster.cpp
diff options
context:
space:
mode:
authorshadowu@mail.bg <none@none>2008-12-19 00:37:40 +0200
committershadowu@mail.bg <none@none>2008-12-19 00:37:40 +0200
commit51f0c70b7ea7eca2b0fcc05a38fa155b7378741f (patch)
tree52f9e2db42bfc10d9fd8b65b26c9884ae6ebe71c /src/game/MotionMaster.cpp
parent058db69e0730975cd0e3e03e5abca78828808dd8 (diff)
*Movement Generators standardization.
- bool GetDestination(&x,&y,&z) added to all movement generators.(it is used by update of players view distance) - Fixed when creature entering in combat not count this as StoppedByPlayer. - Random Movement Generator - added support for creating custom spawndist during the game. - Random Movement Generator - Db spawndist is checked only at initialize(NOT in each sellect of random location). - Added Random Movement to motion master - it can be called now by MoveRandom(spawndist) e.g. for use in SD2. - Home and Random movements no more using RespawnCoords(Home Position has implemented) - Fixed bug when creature is moving on path and enter combat, after that returns to spawn position. -Typo fix in Confused Movement Generator --HG-- branch : trunk
Diffstat (limited to 'src/game/MotionMaster.cpp')
-rw-r--r--src/game/MotionMaster.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/game/MotionMaster.cpp b/src/game/MotionMaster.cpp
index 834770ae8a5..4b667ad9ccd 100644
--- a/src/game/MotionMaster.cpp
+++ b/src/game/MotionMaster.cpp
@@ -30,6 +30,7 @@
#include "PointMovementGenerator.h"
#include "TargetedMovementGenerator.h"
#include "WaypointMovementGenerator.h"
+#include "RandomMovementGenerator.h"
#include <cassert>
@@ -105,6 +106,16 @@ MotionMaster::Clear(bool reset)
}
void
+MotionMaster::MoveRandom(float spawndist)
+{
+ if(i_owner->GetTypeId()==TYPEID_UNIT)
+ {
+ DEBUG_LOG("Creature (GUID: %u) start moving random", i_owner->GetGUIDLow() );
+ Mutate(new RandomMovementGenerator<Creature>(spawndist));
+ }
+}
+
+void
MotionMaster::MovementExpired(bool reset)
{
if( empty() || size() == 1 )