346{
350 return;
351
354
356 {
359 if (member ==
m_leader || !member->
IsAlive() || member->
GetVictim() || !pFormationInfo.
HasGroupFlag(std::underlying_type_t<GroupAIFlags>(GroupAIFlags::GROUP_AI_FLAG_FOLLOW_LEADER)))
360 continue;
361
362
364 continue;
365
366
368 if (
static_cast<float>(M_PI) - std::fabs(std::fabs(
m_leader->
GetOrientation() - pathAngle) -
static_cast<float>(M_PI)) >
static_cast<float>(M_PI)* 0.5f)
369 {
370
371
372
373
375 }
376
377 float const followDist = pFormationInfo.
follow_dist;
378
379 float dx = x + std::cos(followAngle + pathAngle) * followDist;
380 float dy = y + std::sin(followAngle + pathAngle) * followDist;
381 float dz = z;
382
385 if (move_type < 2)
387
388
390 switch (move_type)
391 {
394 break;
397 break;
400 break;
401 }
402
403
404
407
408 if (speedRate > 0.01f)
409 {
413 }
414 }
415}
@ WAYPOINT_MOVE_TYPE_RUN
Definition: WaypointMgr.h:29
@ WAYPOINT_MOVE_TYPE_LAND
Definition: WaypointMgr.h:30
@ WAYPOINT_MOVE_TYPE_WALK
Definition: WaypointMgr.h:28
@ MOVEMENTFLAG_DISABLE_GRAVITY
Definition: UnitDefines.h:354
@ MOVEMENTFLAG_WALKING
Definition: UnitDefines.h:352
@ UNIT_STATE_NOT_MOVE
Definition: UnitDefines.h:197
UnitMoveType
Definition: UnitDefines.h:327
void NormalizeMapCoord(float &c)
Definition: GridDefines.h:208
UnitMoveType SelectSpeedType(uint32 moveFlags)
Definition: MoveSplineInit.cpp:29
void SetHomePosition(float x, float y, float z, float o)
Definition: Creature.h:337
Definition: CreatureGroups.h:51
float follow_dist
Definition: CreatureGroups.h:63
float follow_angle
Definition: CreatureGroups.h:64
bool HasGroupFlag(uint16 flag) const
Definition: CreatureGroups.h:69
void UpdateGroundPositionZ(float x, float y, float &z) const
Definition: Object.cpp:1530
float GetExactDist(float x, float y, float z) const
Definition: Position.h:178
static float NormalizeOrientation(float o)
Definition: Position.h:233
float GetOrientation() const
Definition: Position.h:120
float GetPositionX() const
Definition: Position.h:117
float GetPositionY() const
Definition: Position.h:118
uint32 GetUnitMovementFlags() const
Definition: Unit.h:1614
void SetUnitMovementFlags(uint32 f)
Definition: Unit.h:1615
void AddUnitMovementFlag(uint32 f)
Definition: Unit.h:1611
float GetSpeedRate(UnitMoveType mtype) const
Definition: Unit.h:1587
void SetSpeedRate(UnitMoveType mtype, float rate)
Definition: Unit.h:1589
bool HasUnitState(const uint32 f) const
Definition: Unit.h:673
void RemoveUnitMovementFlag(uint32 f)
Definition: Unit.h:1612
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition: MotionMaster.h:211