From 905ca8e1e4eba81b4183873731ce4ad6475a136b Mon Sep 17 00:00:00 2001 From: Subv Date: Fri, 31 May 2013 12:38:05 -0500 Subject: Core/Movement: Follower creatures in a formation will now follow their leader when the leader was moved with PointMovementGenerator --- .../Movement/MovementGenerators/PointMovementGenerator.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp index ea7a8c4c710..51a23b84342 100755 --- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp @@ -42,6 +42,11 @@ void PointMovementGenerator::DoInitialize(T* unit) if (speed > 0.0f) init.SetVelocity(speed); init.Launch(); + + //Call for creature group update + if (Creature* creature = unit->ToCreature()) + if (creature->GetFormation() && creature->GetFormation()->getLeader() == creature) + creature->GetFormation()->LeaderMoveTo(i_x, i_y, i_z); } template @@ -66,6 +71,11 @@ bool PointMovementGenerator::DoUpdate(T* unit, uint32 /*diff*/) if (speed > 0.0f) // Default value for point motion type is 0.0, if 0.0 spline will use GetSpeed on unit init.SetVelocity(speed); init.Launch(); + + //Call for creature group update + if (Creature* creature = unit->ToCreature()) + if (creature->GetFormation() && creature->GetFormation()->getLeader() == creature) + creature->GetFormation()->LeaderMoveTo(i_x, i_y, i_z); } return !unit->movespline->Finalized(); -- cgit v1.2.3