aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/AI/CreatureAI.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2020-04-24 18:45:56 +0200
committerGitHub <noreply@github.com>2020-04-24 18:45:56 +0200
commit1a415147b9acc945163f6c8044e886983cbe8900 (patch)
treeae2d3709f586815853ef7519619e6f3c24dc8489 /src/server/game/AI/CreatureAI.cpp
parentbbfbb7d4bfa869755e702b40b53dbd295f8c964d (diff)
parent72ffe65dacf9a6eb62f337c2a49d8fff2716febd (diff)
Merge pull request #24433 from funjoker/cherry-picks
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;