347{
351 return;
352
355
357 {
360 if (member ==
m_leader || !member->
IsAlive() || member->
GetVictim() || !pFormationInfo.
HasGroupFlag(std::underlying_type_t<GroupAIFlags>(GroupAIFlags::GROUP_AI_FLAG_FOLLOW_LEADER)))
361 continue;
362
363
365 continue;
366
367
369 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)
370 {
371
372
373
374
376 }
377
378 float const followDist = pFormationInfo.
follow_dist;
379
380 float dx = x + std::cos(followAngle + pathAngle) * followDist;
381 float dy = y + std::sin(followAngle + pathAngle) * followDist;
382 float dz = z;
383
386 if (move_type < 2)
388
389
391 switch (move_type)
392 {
395 break;
398 break;
401 break;
402 }
403
404
405
408
409 if (speedRate > 0.01f)
410 {
414 }
415 }
416}
@ 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
@ WAYPOINT_MOVE_TYPE_RUN
Definition: WaypointMgr.h:29
@ WAYPOINT_MOVE_TYPE_LAND
Definition: WaypointMgr.h:30
@ WAYPOINT_MOVE_TYPE_WALK
Definition: WaypointMgr.h:28
void NormalizeMapCoord(float &c)
Definition: GridDefines.h:207
UnitMoveType SelectSpeedType(uint32 moveFlags)
Definition: MoveSplineInit.cpp:29
void SetHomePosition(float x, float y, float z, float o)
Definition: Creature.h:336
Definition: CreatureGroups.h:52
float follow_dist
Definition: CreatureGroups.h:64
float follow_angle
Definition: CreatureGroups.h:65
bool HasGroupFlag(uint16 flag) const
Definition: CreatureGroups.h:70
void UpdateGroundPositionZ(float x, float y, float &z) const
Definition: Object.cpp:1541
float GetExactDist(float x, float y, float z) const
Definition: Position.h:177
static float NormalizeOrientation(float o)
Definition: Position.h:232
float GetOrientation() const
Definition: Position.h:119
float GetPositionX() const
Definition: Position.h:116
float GetPositionY() const
Definition: Position.h:117
uint32 GetUnitMovementFlags() const
Definition: Unit.h:737
void SetUnitMovementFlags(uint32 f)
Definition: Unit.h:738
void AddUnitMovementFlag(uint32 f)
Definition: Unit.h:734
float GetSpeedRate(UnitMoveType mtype) const
Definition: Unit.h:1601
void SetSpeedRate(UnitMoveType mtype, float rate)
Definition: Unit.h:1603
bool HasUnitState(const uint32 f) const
Definition: Unit.h:701
void RemoveUnitMovementFlag(uint32 f)
Definition: Unit.h:735
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition: MotionMaster.h:213