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/RandomMovementGenerator.cpp | |
parent | e8866340ce2cb717486c8def489ddc9d3046a0cc (diff) |
*Update creature formation code.
--HG--
branch : trunk
Diffstat (limited to 'src/game/RandomMovementGenerator.cpp')
-rw-r--r-- | src/game/RandomMovementGenerator.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/game/RandomMovementGenerator.cpp b/src/game/RandomMovementGenerator.cpp index 3e4912d00cd..763e7f12c5a 100644 --- a/src/game/RandomMovementGenerator.cpp +++ b/src/game/RandomMovementGenerator.cpp @@ -26,6 +26,7 @@ #include "DestinationHolderImp.h" #include "Map.h" #include "Util.h" +#include "CreatureGroups.h" #define RUNNING_CHANCE_RANDOMMV 20 //will be "1 / RUNNING_CHANCE_RANDOMMV" @@ -114,6 +115,12 @@ RandomMovementGenerator<Creature>::_setRandomLocation(Creature &creature) i_nextMoveTime.Reset(urand(500+i_destinationHolder.GetTotalTravelTime(),5000+i_destinationHolder.GetTotalTravelTime())); creature.SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE); } + + //Call for creature group update + if(creature.GetFormation() && creature.GetFormation()->getLeader() == &creature) + { + creature.GetFormation()->LeaderMoveTo(nx, ny, nz); + } } template<> |