Merge pull request #16491 from Treeston/3.3.5-boundarycheck
[3.3.5] Add target boundary check to BossAI CanCreatureAttack call
This commit is contained in:
commit
2c437ff8ec
6 files changed
+8
-6
No files matched your search
@@ -350,7 +350,7 @@ int32 CreatureAI::VisualizeBoundary(uint32 duration, Unit* owner, bool fill) con
|
||||
return boundsWarning ? LANG_CREATURE_MOVEMENT_MAYBE_UNBOUNDED : 0;
|
||||
}
|
||||
|
||||
bool CreatureAI::CheckBoundary(Position* who) const
|
||||
bool CreatureAI::CheckBoundary(Position const* who) const
|
||||
{
|
||||
if (!who)
|
||||
who = me;
|
||||
|
||||
@@ -79,7 +79,7 @@ class CreatureAI : public UnitAI
|
||||
Creature* DoSummon(uint32 entry, WorldObject* obj, float radius = 5.0f, uint32 despawnTime = 30000, TempSummonType summonType = TEMPSUMMON_CORPSE_TIMED_DESPAWN);
|
||||
Creature* DoSummonFlyer(uint32 entry, WorldObject* obj, float flightZ, float radius = 5.0f, uint32 despawnTime = 30000, TempSummonType summonType = TEMPSUMMON_CORPSE_TIMED_DESPAWN);
|
||||
|
||||
bool CheckBoundary(Position* who = nullptr) const;
|
||||
bool CheckBoundary(Position const* who = nullptr) const;
|
||||
void SetBoundary(CreatureBoundary const* boundary) { _boundary = boundary; me->DoImmediateBoundaryCheck(); }
|
||||
public:
|
||||
enum EvadeReason
|
||||
|
||||
@@ -360,6 +360,8 @@ class BossAI : public ScriptedAI
|
||||
void JustDied(Unit* /*killer*/) override { _JustDied(); }
|
||||
void JustReachedHome() override { _JustReachedHome(); }
|
||||
|
||||
bool CanAIAttack(Unit const* target) const override { return CheckBoundary(target); }
|
||||
|
||||
protected:
|
||||
void _Reset();
|
||||
void _EnterCombat();
|
||||
|
||||
Reference in new issue
Block a user