aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/AI/CreatureAI.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2017-05-18 23:52:58 +0200
committerShauren <shauren.trinity@gmail.com>2017-05-18 23:53:25 +0200
commitc5d3dd90bea3889ef5fcd33c9ef0d59d7c544f8a (patch)
treeaa7fde6f924fc39da54908bd6eeeb0be422e5fc3 /src/server/game/AI/CreatureAI.cpp
parent74456703146194de72424ec98c4ea76402077be6 (diff)
Core/Game: Include cleanup
* Mostly aimed at removing Log/DatabaseEnv includes from other headers * Fix most packet headers including other packet headers - moved common structures such as ItemInstance to their own files * Moved SAI function definitions to source files (massive or requiring many different dependencies)
Diffstat (limited to 'src/server/game/AI/CreatureAI.cpp')
-rw-r--r--src/server/game/AI/CreatureAI.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp
index 175c2784654..faac3ad6767 100644
--- a/src/server/game/AI/CreatureAI.cpp
+++ b/src/server/game/AI/CreatureAI.cpp
@@ -41,6 +41,14 @@ void CreatureAI::OnCharmed(bool apply)
AISpellInfoType* UnitAI::AISpellInfo;
AISpellInfoType* GetAISpellInfo(uint32 i) { return &CreatureAI::AISpellInfo[i]; }
+CreatureAI::CreatureAI(Creature* creature) : UnitAI(creature), me(creature), _boundary(nullptr), m_MoveInLineOfSight_locked(false)
+{
+}
+
+CreatureAI::~CreatureAI()
+{
+}
+
void CreatureAI::Talk(uint8 id, WorldObject const* whisperTarget /*= nullptr*/)
{
sCreatureTextMgr->SendChat(me, id, whisperTarget);
@@ -363,6 +371,12 @@ bool CreatureAI::CheckBoundary(Position const* who) const
return true;
}
+void CreatureAI::SetBoundary(CreatureBoundary const* boundary)
+{
+ _boundary = boundary;
+ me->DoImmediateBoundaryCheck();
+}
+
bool CreatureAI::CheckInRoom()
{
if (CheckBoundary())