aboutsummaryrefslogtreecommitdiff
path: root/src/game/RandomMovementGenerator.cpp
diff options
context:
space:
mode:
authorQAston <none@none>2009-04-07 20:40:00 +0200
committerQAston <none@none>2009-04-07 20:40:00 +0200
commit741b51cc471d8a3f897b7ded51e1d3122e3d8300 (patch)
tree3c579933847679c780be6b672e00d636a32690dd /src/game/RandomMovementGenerator.cpp
parent26b856a5135f51372cb1b15de21a0e995cdb6435 (diff)
parentc6b6a72956efdc10da8fac982db734b054984d08 (diff)
*Merge
--HG-- branch : trunk
Diffstat (limited to 'src/game/RandomMovementGenerator.cpp')
-rw-r--r--src/game/RandomMovementGenerator.cpp7
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<>