diff options
author | QAston <none@none> | 2009-04-07 20:40:00 +0200 |
---|---|---|
committer | QAston <none@none> | 2009-04-07 20:40:00 +0200 |
commit | 741b51cc471d8a3f897b7ded51e1d3122e3d8300 (patch) | |
tree | 3c579933847679c780be6b672e00d636a32690dd /src/game/WaypointMovementGenerator.cpp | |
parent | 26b856a5135f51372cb1b15de21a0e995cdb6435 (diff) | |
parent | c6b6a72956efdc10da8fac982db734b054984d08 (diff) |
*Merge
--HG--
branch : trunk
Diffstat (limited to 'src/game/WaypointMovementGenerator.cpp')
-rw-r--r-- | src/game/WaypointMovementGenerator.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp index fd2b0b8bb86..7c606697ac3 100644 --- a/src/game/WaypointMovementGenerator.cpp +++ b/src/game/WaypointMovementGenerator.cpp @@ -24,6 +24,7 @@ //Creature-specific headers #include "Creature.h" #include "CreatureAI.h" +#include "CreatureGroups.h" //Player-specific #include "Player.h" @@ -54,7 +55,7 @@ bool WaypointMovementGenerator<Creature>::GetDestination(float &x, float &y, flo { if(i_destinationHolder.HasArrived()) return false; - + i_destinationHolder.GetDestination(x, y, z); return true; } @@ -109,6 +110,10 @@ WaypointMovementGenerator<Creature>::Initialize(Creature &u) InitTraveller(u, *node); i_destinationHolder.SetDestination(traveller, node->x, node->y, node->z); i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime()); + + //Call for creature group update + if(u.GetFormation() && u.GetFormation()->getLeader() == &u) + u.GetFormation()->LeaderMoveTo(node->x, node->y, node->z); } else node = NULL; @@ -180,6 +185,10 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff) InitTraveller(unit, *node); i_destinationHolder.SetDestination(traveller, node->x, node->y, node->z); i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime()); + + //Call for creature group update + if(unit.GetFormation() && unit.GetFormation()->getLeader() == &unit) + unit.GetFormation()->LeaderMoveTo(node->x, node->y, node->z); } else { |