mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-16 00:36:07 +00:00
fix(Core/Creature): Prevent combat movement disabled creatures from r… (#18428)
* fix(Core/Creature): Prevent combat movement disabled creatures from repositioning if target moves within model boundary * fixbuild * Apply suggestions from code review
This commit is contained in:
@@ -348,7 +348,7 @@ void CreatureAI::MoveCircleChecks()
|
||||
!victim ||
|
||||
!me->IsFreeToMove() || me->HasUnitMovementFlag(MOVEMENTFLAG_ROOT) ||
|
||||
!me->IsWithinMeleeRange(victim) || me == victim->GetVictim() ||
|
||||
(victim->GetTypeId() != TYPEID_PLAYER && !victim->IsPet()) // only player & pets to save CPU
|
||||
(!victim->IsPlayer() && !victim->IsPet()) // only player & pets to save CPU
|
||||
)
|
||||
{
|
||||
return;
|
||||
@@ -357,14 +357,12 @@ void CreatureAI::MoveCircleChecks()
|
||||
me->GetMotionMaster()->MoveCircleTarget(me->GetVictim());
|
||||
}
|
||||
|
||||
void CreatureAI::MoveBackwardsChecks() {
|
||||
void CreatureAI::MoveBackwardsChecks()
|
||||
{
|
||||
Unit *victim = me->GetVictim();
|
||||
|
||||
if (
|
||||
!victim ||
|
||||
!me->IsFreeToMove() || me->HasUnitMovementFlag(MOVEMENTFLAG_ROOT) ||
|
||||
(victim->GetTypeId() != TYPEID_PLAYER && !victim->IsPet())
|
||||
)
|
||||
if (!victim || !me->IsFreeToMove() || me->HasUnitMovementFlag(MOVEMENTFLAG_ROOT) ||
|
||||
(!victim->IsPlayer() && !victim->IsPet()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user