aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2017-03-28 01:52:49 -0300
committerariel- <ariel-@users.noreply.github.com>2017-03-28 01:52:49 -0300
commit2f99fa09c9bacbad376d7a296c3311f94ec8a552 (patch)
treee3eebad6cda4b6a0338d5226331ae8942a6cd886 /src/server/scripts
parent97e54fe4582e59c268bd77020c59f467d0b20327 (diff)
Core/AI: AreaBoundary refactor
- Added an auxiliary function IsInBounds to base CreatureAI - Changed container to vector. Set had no sense because we're storing new pointers, they have different addresses even if the boundary is the same
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp
index 3413a740253..aec3210763b 100644
--- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp
@@ -476,15 +476,6 @@ class npc_anubarak_anub_ar_assassin : public CreatureScript
{
npc_anubarak_anub_ar_assassinAI(Creature* creature) : npc_anubarak_pet_template(creature, false), _backstabTimer(6 * IN_MILLISECONDS) { }
- bool IsInBounds(Position const& jumpTo, CreatureBoundary const* boundary)
- {
- if (!boundary)
- return true;
- for (CreatureBoundary::const_iterator it = boundary->cbegin(); it != boundary->cend(); ++it)
- if (!(*it)->IsWithinBoundary(&jumpTo))
- return false;
- return true;
- }
Position GetRandomPositionAround(Creature* anubarak)
{
static float DISTANCE_MIN = 10.0f;
@@ -501,7 +492,7 @@ class npc_anubarak_anub_ar_assassin : public CreatureScript
Position jumpTo;
do
jumpTo = GetRandomPositionAround(anubarak);
- while (!IsInBounds(jumpTo, boundary));
+ while (!CreatureAI::IsInBounds(boundary, &jumpTo));
me->GetMotionMaster()->MoveJump(jumpTo, 40.0f, 40.0f);
DoCastSelf(SPELL_ASSASSIN_VISUAL, true);
}