mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 18:15:31 +01:00
Core/Movement: FormationMovementGenerator
Use own movement generator for creatures following on a formation.
First step of implementation, huge room for improvement.
Closes #19422
(cherry picked from commit 46221b6dc1)
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#include "WaypointMovementGenerator.h"
|
||||
#include "RandomMovementGenerator.h"
|
||||
#include "SplineChainMovementGenerator.h"
|
||||
#include "FormationMovementGenerator.h"
|
||||
#include "MoveSpline.h"
|
||||
#include "MoveSplineInit.h"
|
||||
#include "PathGenerator.h"
|
||||
@@ -711,6 +712,15 @@ void MotionMaster::MoveRotate(uint32 time, RotateDirection direction)
|
||||
Mutate(new RotateMovementGenerator(time, direction), MOTION_SLOT_ACTIVE);
|
||||
}
|
||||
|
||||
void MotionMaster::MoveFormation(uint32 id, Position destination, uint32 moveType, bool forceRun /*= false*/, bool forceOrientation /*= false*/)
|
||||
{
|
||||
if (_owner->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
TC_LOG_DEBUG("misc", "MotionMaster::MoveFormation: Creature (Entry: %u %s) targeted point (Id: %u X: %f Y: %f Z: %f).", _owner->GetEntry(), _owner->GetGUID().ToString().c_str(), id, destination.GetPositionX(), destination.GetPositionY(), destination.GetPositionZ());
|
||||
Mutate(new FormationMovementGenerator(id, destination, moveType, forceRun, forceOrientation), MOTION_SLOT_ACTIVE);
|
||||
}
|
||||
}
|
||||
|
||||
/******************** Private methods ********************/
|
||||
|
||||
void MotionMaster::pop()
|
||||
|
||||
Reference in New Issue
Block a user