aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/AI/CreatureAI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/AI/CreatureAI.cpp')
-rw-r--r--src/server/game/AI/CreatureAI.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp
index 7fbc8ed2ed5..b9d052cb528 100644
--- a/src/server/game/AI/CreatureAI.cpp
+++ b/src/server/game/AI/CreatureAI.cpp
@@ -368,13 +368,25 @@ bool CreatureAI::CheckBoundary(Position const* who) const
who = me;
if (_boundary)
- for (AreaBoundary const* boundary : *_boundary)
- if (!boundary->IsWithinBoundary(who))
+ for (AreaBoundary const* areaBoundary : *_boundary)
+ if (!areaBoundary->IsWithinBoundary(who))
return false;
return true;
}
+bool CreatureAI::IsInBounds(CreatureBoundary const* boundary, Position const* pos)
+{
+ if (!boundary)
+ return true;
+
+ for (AreaBoundary const* areaBoundary : *boundary)
+ if (!areaBoundary->IsWithinBoundary(pos))
+ return false;
+
+ return true;
+}
+
void CreatureAI::SetBoundary(CreatureBoundary const* boundary)
{
_boundary = boundary;