aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/AI/CreatureAI.cpp
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2018-03-08 18:41:46 +0100
committerShauren <shauren.trinity@gmail.com>2021-08-23 23:28:48 +0200
commit994121e671127ce11df4e631ab0a4c310234191f (patch)
tree13caa6f19c9f0dc651fe8fc922aef1960be630fd /src/server/game/AI/CreatureAI.cpp
parent69c6c5965979477e1589aefd9670571a91411029 (diff)
Core/CreatureAI: CheckBoundary -> IsInBoundary, better reflects what it does. Also moved to public so spellscript can use it.
(cherry picked from commit df639d85e4e82add71432ea0a4cba91f238a30ba)
Diffstat (limited to 'src/server/game/AI/CreatureAI.cpp')
-rw-r--r--src/server/game/AI/CreatureAI.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp
index 87ad5851e39..4ef70b18529 100644
--- a/src/server/game/AI/CreatureAI.cpp
+++ b/src/server/game/AI/CreatureAI.cpp
@@ -265,13 +265,13 @@ int32 CreatureAI::VisualizeBoundary(uint32 duration, Unit* owner, bool fill) con
std::unordered_set<coordinate> outOfBounds;
Position startPosition = owner->GetPosition();
- if (!CheckBoundary(&startPosition))
+ if (!IsInBoundary(&startPosition))
{ // fall back to creature position
startPosition = me->GetPosition();
- if (!CheckBoundary(&startPosition))
+ if (!IsInBoundary(&startPosition))
{ // fall back to creature home position
startPosition = me->GetHomePosition();
- if (!CheckBoundary(&startPosition))
+ if (!IsInBoundary(&startPosition))
return LANG_CREATURE_NO_INTERIOR_POINT_FOUND;
}
}
@@ -294,7 +294,7 @@ int32 CreatureAI::VisualizeBoundary(uint32 duration, Unit* owner, bool fill) con
if (alreadyChecked.find(next) == alreadyChecked.end()) // never check a coordinate twice
{
Position nextPos(startPosition.GetPositionX() + next.first*BOUNDARY_VISUALIZE_STEP_SIZE, startPosition.GetPositionY() + next.second*BOUNDARY_VISUALIZE_STEP_SIZE, startPosition.GetPositionZ());
- if (CheckBoundary(&nextPos))
+ if (IsInBoundary(&nextPos))
Q.push(next);
else
{
@@ -321,7 +321,7 @@ int32 CreatureAI::VisualizeBoundary(uint32 duration, Unit* owner, bool fill) con
return boundsWarning ? LANG_CREATURE_MOVEMENT_MAYBE_UNBOUNDED : 0;
}
-bool CreatureAI::CheckBoundary(Position const* who) const
+bool CreatureAI::IsInBoundary(Position const* who) const
{
if (!_boundary)
return true;
@@ -350,7 +350,7 @@ void CreatureAI::SetBoundary(CreatureBoundary const* boundary, bool negateBounda
bool CreatureAI::CheckInRoom()
{
- if (CheckBoundary())
+ if (IsInBoundary())
return true;
else
{