aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorshadowu@mail.bg <none@none>2008-12-14 18:16:25 +0200
committershadowu@mail.bg <none@none>2008-12-14 18:16:25 +0200
commit395116752b79401cf79e988b36567988c60c3ab2 (patch)
tree2e1d306060f1e9f0f61ab3871e039a1200c0a2b1 /src
parentd7f76aec992a36817a3ab474379aa2b7421ebfed (diff)
*Implements missing bool getDestination(float &, float &, float &) function in random movement generator
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/RandomMovementGenerator.cpp11
-rw-r--r--src/game/RandomMovementGenerator.h3
2 files changed, 13 insertions, 1 deletions
diff --git a/src/game/RandomMovementGenerator.cpp b/src/game/RandomMovementGenerator.cpp
index cb7cb6ffcda..311cc7c6e17 100644
--- a/src/game/RandomMovementGenerator.cpp
+++ b/src/game/RandomMovementGenerator.cpp
@@ -28,6 +28,17 @@
#define RUNNING_CHANCE_RANDOMMV 20 //will be "1 / RUNNING_CHANCE_RANDOMMV"
template<>
+bool
+RandomMovementGenerator<Creature>::GetDestination(float &x, float &y, float &z) const
+{
+ if(i_destinationHolder.HasArrived())
+ return false;
+
+ i_destinationHolder.GetDestination(x, y, z);
+ return true;
+}
+
+template<>
void
RandomMovementGenerator<Creature>::_setRandomLocation(Creature &creature)
{
diff --git a/src/game/RandomMovementGenerator.h b/src/game/RandomMovementGenerator.h
index 2825bc306a8..dd6e3a48283 100644
--- a/src/game/RandomMovementGenerator.h
+++ b/src/game/RandomMovementGenerator.h
@@ -38,7 +38,8 @@ class TRINITY_DLL_SPEC RandomMovementGenerator
void Finalize(T &) {}
void Reset(T &);
bool Update(T &, const uint32 &);
- void UpdateMapPosition(uint32 mapid, float &x ,float &y, float &z)
+ bool GetDestination(float &x, float &y, float &z) const;
+ void UpdateMapPosition(uint32 mapid, float &x ,float &y, float &z)
{
i_destinationHolder.GetLocationNow(mapid, x,y,z);
}