feat(Core): port aggro distance from vMaNGOS (#6214)

Read detection_range values from creature_template
This commit is contained in:
Shiroe
2021-07-08 18:01:27 +02:00
committed by GitHub
parent 6fa2ad4e33
commit f8c8e98a0a
15 changed files with 89 additions and 72 deletions

View File

@@ -120,7 +120,7 @@ void CreatureAI::MoveInLineOfSight(Unit* who)
if (me->IsMoveInLineOfSightDisabled())
if (me->GetCreatureType() == CREATURE_TYPE_NON_COMBAT_PET || // nothing more to do, return
!who->IsInCombat() || // if not in combat, nothing more to do
!me->IsWithinDist(who, ATTACK_DISTANCE)) // if in combat and in dist - neutral to all can actually assist other creatures
!me->IsWithinDist(who, ATTACK_DISTANCE, true, false)) // if in combat and in dist - neutral to all can actually assist other creatures
return;
if (me->CanStartAttack(who))