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 fea83963924..b152773509b 100644
--- a/src/server/game/AI/CreatureAI.cpp
+++ b/src/server/game/AI/CreatureAI.cpp
@@ -358,13 +358,25 @@ bool CreatureAI::CheckBoundary(Position const* who) const
who = me;
if (_boundary)
- for (CreatureBoundary::const_iterator it = _boundary->begin(); it != _boundary->end(); ++it)
- if (!(*it)->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;
+}
+
bool CreatureAI::CheckInRoom()
{
if (CheckBoundary())