diff options
| author | Treeston <treeston.mmoc@gmail.com> | 2018-03-08 18:41:46 +0100 |
|---|---|---|
| committer | Treeston <treeston.mmoc@gmail.com> | 2018-03-08 18:41:46 +0100 |
| commit | df639d85e4e82add71432ea0a4cba91f238a30ba (patch) | |
| tree | 6fffc85dae24ae1a71db094231a928c5da41609c /src/server/game/AI/CreatureAI.cpp | |
| parent | 5df0a020fa54cc658ec6ae8e5df1cecd2cf3d3dc (diff) | |
Core/CreatureAI: CheckBoundary -> IsInBoundary, better reflects what it does. Also moved to public so spellscript can use it.
Diffstat (limited to 'src/server/game/AI/CreatureAI.cpp')
| -rw-r--r-- | src/server/game/AI/CreatureAI.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp index fec1166481a..22e2226af50 100644 --- a/src/server/game/AI/CreatureAI.cpp +++ b/src/server/game/AI/CreatureAI.cpp @@ -258,13 +258,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; } } @@ -287,7 +287,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 { @@ -314,7 +314,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; @@ -336,7 +336,7 @@ bool CreatureAI::IsInBounds(CreatureBoundary const& boundary, Position const* po bool CreatureAI::CheckInRoom() { - if (CheckBoundary()) + if (IsInBoundary()) return true; else { |
