From 395116752b79401cf79e988b36567988c60c3ab2 Mon Sep 17 00:00:00 2001 From: "shadowu@mail.bg" Date: Sun, 14 Dec 2008 18:16:25 +0200 Subject: [PATCH] *Implements missing bool getDestination(float &, float &, float &) function in random movement generator --HG-- branch : trunk --- src/game/RandomMovementGenerator.cpp | 11 +++++++++++ src/game/RandomMovementGenerator.h | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/game/RandomMovementGenerator.cpp b/src/game/RandomMovementGenerator.cpp index cb7cb6ffcd..311cc7c6e1 100644 --- a/src/game/RandomMovementGenerator.cpp +++ b/src/game/RandomMovementGenerator.cpp @@ -27,6 +27,17 @@ #define RUNNING_CHANCE_RANDOMMV 20 //will be "1 / RUNNING_CHANCE_RANDOMMV" +template<> +bool +RandomMovementGenerator::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::_setRandomLocation(Creature &creature) diff --git a/src/game/RandomMovementGenerator.h b/src/game/RandomMovementGenerator.h index 2825bc306a..dd6e3a4828 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); }