79 if (!owner || !owner->
IsAlive())
108 if (cOwner->IsIgnoringChaseRange())
140 _path = std::make_unique<PathGenerator>(owner);
153 if (diffUpper < diffLower)
165 bool allowShortcut =
false;
168 if (target->
GetGUID() == oPet->GetOwnerGUID())
169 allowShortcut =
true;
172 bool success =
_path->CalculatePath(x, y, z, allowShortcut);
#define ASSERT_NOTNULL(pointer)
static bool PositionOkay(Unit *owner, Unit *target, float range, Optional< ChaseAngle > angle={})
static void DoMovementInform(Unit *owner, Unit *target)
#define FOLLOW_RANGE_TOLERANCE
@ MOVEMENTGENERATOR_FLAG_INITIALIZATION_PENDING
@ MOVEMENTGENERATOR_FLAG_DEACTIVATED
@ MOVEMENTGENERATOR_FLAG_FINALIZED
@ MOVEMENTGENERATOR_FLAG_TRANSITORY
@ MOVEMENTGENERATOR_FLAG_INFORM_ENABLED
@ MOVEMENTGENERATOR_FLAG_INITIALIZED
std::optional< T > Optional
Optional helper class to wrap optional values within.
void Reset(Unit *) override
bool Update(Unit *, uint32) override
void Finalize(Unit *, bool, bool) override
Optional< TimeTracker > _duration
FollowMovementGenerator(Unit *target, float range, ChaseAngle angle, Optional< Milliseconds > duration)
~FollowMovementGenerator()
void Initialize(Unit *) override
Optional< Position > _lastTargetPosition
std::unique_ptr< PathGenerator > _path
void UpdatePetSpeed(Unit *owner)
static constexpr uint32 CHECK_INTERVAL
void Deactivate(Unit *) override
void AddFlag(uint16 const flag)
bool HasFlag(uint16 const flag) const
void RemoveFlag(uint16 const flag)
void SetWalk(bool enable)
void SetFacing(float angle)
void MovebyPath(PointsArray const &path, int32 pointId=0)
LowType GetCounter() const
static Creature * ToCreature(Object *o)
static ObjectGuid GetGUID(Object const *o)
void ClearUnitState(uint32 f)
virtual bool IsMovementPreventedByCasting() const
ObjectGuid GetOwnerGUID() const override
float GetCombatReach() const override
void AddUnitState(uint32 f)
bool HasUnitState(const uint32 f) const
std::unique_ptr< Movement::MoveSpline > movespline
void UpdateAllowedPositionZ(float x, float y, float &z, float *groundZ=nullptr) const
void GetNearPoint(WorldObject const *searcher, float &x, float &y, float &z, float distance2d, float absAngle) const
bool IsAngleOkay(float relativeAngle) const
float GetRelativeAngle(float x, float y) const
static float NormalizeOrientation(float o)
float ToAbsoluteAngle(float relAngle) const
constexpr void GetPosition(float &x, float &y) const
constexpr float GetExactDistSq(float x, float y, float z) const
constexpr float GetOrientation() const