diff options
author | megamage <none@none> | 2009-04-06 20:33:52 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-04-06 20:33:52 -0500 |
commit | ac4edf0e091f0a1e0b49ae39201183613f3453ad (patch) | |
tree | 8ff4f3be6bc305ae9bef92caee25cd29670c833d /src/game/WaypointMovementGenerator.cpp | |
parent | e8866340ce2cb717486c8def489ddc9d3046a0cc (diff) |
*Update creature formation code.
--HG--
branch : trunk
Diffstat (limited to 'src/game/WaypointMovementGenerator.cpp')
-rw-r--r-- | src/game/WaypointMovementGenerator.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp index aae6eacc9c6..c6607b2b24e 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" @@ -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 { |