mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-16 00:36:07 +00:00
fix (Core/Movement) Allow MoveFollow to not inherit walkstate of the target to fix Enchanted Elemental speed (#19498)
* MoveFollow with own walkstate * switch
This commit is contained in:
@@ -520,7 +520,9 @@ bool FollowMovementGenerator<T>::DoUpdate(T* owner, uint32 time_diff)
|
||||
|
||||
Movement::MoveSplineInit init(owner);
|
||||
init.MovebyPath(i_path->GetPath());
|
||||
init.SetWalk(target->IsWalking() || target->movespline->isWalking());
|
||||
if (_inheritWalkState)
|
||||
init.SetWalk(target->IsWalking() || target->movespline->isWalking());
|
||||
|
||||
if (Optional<float> velocity = GetVelocity(owner, target, i_path->GetActualEndPosition(), owner->IsGuardian()))
|
||||
init.SetVelocity(*velocity);
|
||||
init.Launch();
|
||||
|
||||
@@ -74,8 +74,8 @@ template<class T>
|
||||
class FollowMovementGenerator : public MovementGeneratorMedium<T, FollowMovementGenerator<T>>, public TargetedMovementGeneratorBase
|
||||
{
|
||||
public:
|
||||
FollowMovementGenerator(Unit* target, float range, ChaseAngle angle)
|
||||
: TargetedMovementGeneratorBase(target), i_path(nullptr), i_recheckPredictedDistanceTimer(0), i_recheckPredictedDistance(false), _range(range), _angle(angle) {}
|
||||
FollowMovementGenerator(Unit* target, float range, ChaseAngle angle, bool inheritWalkState)
|
||||
: TargetedMovementGeneratorBase(target), i_path(nullptr), i_recheckPredictedDistanceTimer(0), i_recheckPredictedDistance(false), _range(range), _angle(angle),_inheritWalkState(inheritWalkState) {}
|
||||
~FollowMovementGenerator() { }
|
||||
|
||||
MovementGeneratorType GetMovementGeneratorType() { return FOLLOW_MOTION_TYPE; }
|
||||
@@ -106,6 +106,7 @@ private:
|
||||
Optional<Position> _lastPredictedPosition;
|
||||
float _range;
|
||||
ChaseAngle _angle;
|
||||
bool _inheritWalkState;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user