diff options
author | Machiavelli <machiavelli.trinity@gmail.com> | 2011-09-28 11:47:30 +0200 |
---|---|---|
committer | Machiavelli <machiavelli.trinity@gmail.com> | 2011-09-28 11:49:25 +0200 |
commit | 18665d19b406981386fd6259ba2366bcd334df3e (patch) | |
tree | ef67ae047637667fa9307e135504b770df67da91 /src/server/game/AI/CreatureAI.cpp | |
parent | b93067350cdd2bc80b907908473f563b25a7e378 (diff) |
Core/Scripts: Add an additional parameter to DoZoneInCombat to define the max range to find a target in to engage (instead of hard coded 50 yards).
Diffstat (limited to 'src/server/game/AI/CreatureAI.cpp')
-rwxr-xr-x | src/server/game/AI/CreatureAI.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp index b72556dbab1..ea229169dda 100755 --- a/src/server/game/AI/CreatureAI.cpp +++ b/src/server/game/AI/CreatureAI.cpp @@ -42,7 +42,7 @@ void CreatureAI::Talk(uint8 id, uint64 WhisperGuid) sCreatureTextMgr->SendChat(me, id, WhisperGuid); } -void CreatureAI::DoZoneInCombat(Creature* creature /*= NULL*/) +void CreatureAI::DoZoneInCombat(Creature* creature /*= NULL*/, float maxRangeToNearestTarget /* = 50.0f*/) { if (!creature) creature = me; @@ -59,7 +59,7 @@ void CreatureAI::DoZoneInCombat(Creature* creature /*= NULL*/) if (!creature->HasReactState(REACT_PASSIVE) && !creature->getVictim()) { - if (Unit* target = creature->SelectNearestTarget(50)) + if (Unit* target = creature->SelectNearestTarget(maxRangeToNearestTarget)) creature->AI()->AttackStart(target); else if (creature->isSummon()) { |