diff options
| author | ariel- <ariel-@users.noreply.github.com> | 2017-03-28 01:52:49 -0300 |
|---|---|---|
| committer | ariel- <ariel-@users.noreply.github.com> | 2017-03-28 01:52:49 -0300 |
| commit | 2f99fa09c9bacbad376d7a296c3311f94ec8a552 (patch) | |
| tree | e3eebad6cda4b6a0338d5226331ae8942a6cd886 /src/server/game/AI/CreatureAI.h | |
| parent | 97e54fe4582e59c268bd77020c59f467d0b20327 (diff) | |
Core/AI: AreaBoundary refactor
- Added an auxiliary function IsInBounds to base CreatureAI
- Changed container to vector. Set had no sense because we're storing new pointers, they have different addresses even if the boundary is the same
Diffstat (limited to 'src/server/game/AI/CreatureAI.h')
| -rw-r--r-- | src/server/game/AI/CreatureAI.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/server/game/AI/CreatureAI.h b/src/server/game/AI/CreatureAI.h index 1d776a38075..5a8158f1a69 100644 --- a/src/server/game/AI/CreatureAI.h +++ b/src/server/game/AI/CreatureAI.h @@ -65,7 +65,7 @@ enum SCEquip EQUIP_UNEQUIP = 0 }; -typedef std::set<AreaBoundary const*> CreatureBoundary; +typedef std::vector<AreaBoundary const*> CreatureBoundary; class TC_GAME_API CreatureAI : public UnitAI { protected: @@ -81,6 +81,8 @@ class TC_GAME_API CreatureAI : public UnitAI Creature* DoSummonFlyer(uint32 entry, WorldObject* obj, float flightZ, float radius = 5.0f, uint32 despawnTime = 30000, TempSummonType summonType = TEMPSUMMON_CORPSE_TIMED_DESPAWN); bool CheckBoundary(Position const* who = nullptr) const; + static bool IsInBounds(CreatureBoundary const* boundary, Position const* who); + void SetBoundary(CreatureBoundary const* boundary) { _boundary = boundary; me->DoImmediateBoundaryCheck(); } public: enum EvadeReason |
