mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +00:00
fix(Core/Movement): properly initialized combat distance for creatures with SAI script (#7437)
- Closes #7331
This commit is contained in:
@@ -800,7 +800,8 @@ void SmartAI::AttackStart(Unit* who)
|
|||||||
me->GetMotionMaster()->MovementExpired();
|
me->GetMotionMaster()->MovementExpired();
|
||||||
me->StopMoving();
|
me->StopMoving();
|
||||||
}
|
}
|
||||||
me->GetMotionMaster()->MoveChase(who, GetScript()->GetCasterActualDist() ? GetScript()->GetCasterActualDist() : GetScript()->GetActualCombatDist());
|
float range = GetScript()->GetCasterActualDist() > 0.f ? GetScript()->GetCasterActualDist() : GetScript()->GetActualCombatDist();
|
||||||
|
me->GetMotionMaster()->MoveChase(who, range > 0.f ? ChaseRange(range) : std::optional<ChaseRange>());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user