diff options
author | megamage <none@none> | 2009-04-06 20:40:18 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-04-06 20:40:18 -0500 |
commit | 8c97e8b78718ba4fa5573fa07af496a388299227 (patch) | |
tree | 859a80c6827034c9d4d04d26fac4787d0e425017 /src/game/RandomMovementGenerator.cpp | |
parent | 9b908e4014de8d4ef428c74f94c480405160cfa7 (diff) | |
parent | ac4edf0e091f0a1e0b49ae39201183613f3453ad (diff) |
*Merge.
--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<> |