diff options
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..0081c702abd 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<> |