diff --git a/src/game/MotionGenerators/TargetedMovementGenerator.cpp b/src/game/MotionGenerators/TargetedMovementGenerator.cpp index 9942b020c7c..5257124ee49 100644 --- a/src/game/MotionGenerators/TargetedMovementGenerator.cpp +++ b/src/game/MotionGenerators/TargetedMovementGenerator.cpp @@ -141,6 +141,7 @@ void ChaseMovementGenerator::Initialize(Unit& owner) _setLocation(owner); i_target->GetPosition(i_lastTargetPos.x, i_lastTargetPos.y, i_lastTargetPos.z); m_fanningEnabled = !(owner.GetTypeId() == TYPEID_UNIT && static_cast(owner).IsWorldBoss()); + m_backpedalEnabled = !(owner.GetTypeId() == TYPEID_UNIT && static_cast(owner).GetSettings().HasFlag(CreatureStaticFlags4::DONT_REPOSITION_IF_MELEE_TARGET_IS_TOO_CLOSE)); } void ChaseMovementGenerator::Finalize(Unit& owner) @@ -394,6 +395,9 @@ void ChaseMovementGenerator::Backpedal(Unit& owner) if (!owner.AI() || owner.AI()->GetCombatScriptStatus()) return; + if (!m_backpedalEnabled) + return; + m_closenessExpired = false; m_closenessAndFanningTimer = CHASE_CLOSENESS_TIMER; // Just in case path doesnt generate float targetDist = std::min(this->i_target->GetCombinedCombatReach(&owner, false), 3.75f); diff --git a/src/game/MotionGenerators/TargetedMovementGenerator.h b/src/game/MotionGenerators/TargetedMovementGenerator.h index 2b5cf6cf6df..05c8d92af0f 100644 --- a/src/game/MotionGenerators/TargetedMovementGenerator.h +++ b/src/game/MotionGenerators/TargetedMovementGenerator.h @@ -112,7 +112,7 @@ class ChaseMovementGenerator : public TargetedMovementGeneratorMedium(target, offset, angle), m_moveFurther(moveFurther), m_walk(walk), m_combat(combat), m_currentMode(CHASE_MODE_NORMAL), - m_fanningEnabled(true), m_closenessAndFanningTimer(0), m_closenessExpired(false), m_reachable(true) {} + m_fanningEnabled(true), m_backpedalEnabled(true), m_closenessAndFanningTimer(0), m_closenessExpired(false), m_reachable(true) {} ~ChaseMovementGenerator() {} MovementGeneratorType GetMovementGeneratorType() const override { return CHASE_MOTION_TYPE; } @@ -166,6 +166,7 @@ class ChaseMovementGenerator : public TargetedMovementGeneratorMedium