diff options
| author | treeston <treeston.mmoc@gmail.com> | 2016-05-05 13:20:52 +0200 |
|---|---|---|
| committer | treeston <treeston.mmoc@gmail.com> | 2016-05-05 13:20:52 +0200 |
| commit | 59ac77522347310deba77195e3b2c5d8552561e3 (patch) | |
| tree | 17c6ba1c424845613a7ff40cc4369929fb025064 /src/server/game/AI/CreatureAI.cpp | |
| parent | 58486fc19ad51eaff2ef1a4a5ddd8edfdedec28d (diff) | |
| parent | 7b1560fccba77ecbdfecd7b33af740aea41b7087 (diff) | |
Merge branch '3.3.5-evademore' into 3.3.5 (PR #16834)
Diffstat (limited to 'src/server/game/AI/CreatureAI.cpp')
| -rw-r--r-- | src/server/game/AI/CreatureAI.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp index 8e6540ed89c..d52306b8a2e 100644 --- a/src/server/game/AI/CreatureAI.cpp +++ b/src/server/game/AI/CreatureAI.cpp @@ -268,6 +268,7 @@ bool CreatureAI::_EnterEvadeMode(EvadeReason /*why*/) me->SetLootRecipient(NULL); me->ResetPlayerDamageReq(); me->SetLastDamagedTime(0); + me->SetCannotReachTarget(false); if (me->IsInEvadeMode()) return false; @@ -275,11 +276,11 @@ bool CreatureAI::_EnterEvadeMode(EvadeReason /*why*/) return true; } -#define BOUNDARY_VISUALIZE_CREATURE 15425 -#define BOUNDARY_VISUALIZE_CREATURE_SCALE 0.25f -#define BOUNDARY_VISUALIZE_STEP_SIZE 1 -#define BOUNDARY_VISUALIZE_FAILSAFE_LIMIT 750 -#define BOUNDARY_VISUALIZE_SPAWN_HEIGHT 5 +static const uint32 BOUNDARY_VISUALIZE_CREATURE = 15425; +static const float BOUNDARY_VISUALIZE_CREATURE_SCALE = 0.25f; +static const int8 BOUNDARY_VISUALIZE_STEP_SIZE = 1; +static const int32 BOUNDARY_VISUALIZE_FAILSAFE_LIMIT = 750; +static const float BOUNDARY_VISUALIZE_SPAWN_HEIGHT = 5.0f; int32 CreatureAI::VisualizeBoundary(uint32 duration, Unit* owner, bool fill) const { typedef std::pair<int32, int32> coordinate; @@ -295,13 +296,13 @@ int32 CreatureAI::VisualizeBoundary(uint32 duration, Unit* owner, bool fill) con std::unordered_set<coordinate> outOfBounds; Position startPosition = owner->GetPosition(); - if (!CheckBoundary(&startPosition)) // fall back to creature position - { + if (!CheckBoundary(&startPosition)) + { // fall back to creature position startPosition = me->GetPosition(); if (!CheckBoundary(&startPosition)) - { + { // fall back to creature home position startPosition = me->GetHomePosition(); - if (!CheckBoundary(&startPosition)) // fall back to creature home position + if (!CheckBoundary(&startPosition)) return LANG_CREATURE_NO_INTERIOR_POINT_FOUND; } } |
