diff options
author | Seyden <saiifii@live.de> | 2021-10-22 12:51:45 +0200 |
---|---|---|
committer | Naios <naios-dev@live.de> | 2021-10-22 12:52:37 +0200 |
commit | 8f097e4425d182c03b26d847c0537207d9f3cd2e (patch) | |
tree | d9d6233d0cd2d75978a97ab8b3c73429886322a4 /src/server/game/AI/CreatureAI.cpp | |
parent | 972105183a16c9ac8c43f379cce4acc8bf764cd8 (diff) |
Core/Scripts: Implement script name reloading
* Authored by Seyden
* Co-authored by Naios
* We thank Shauren for your helpful feedback
Diffstat (limited to 'src/server/game/AI/CreatureAI.cpp')
-rw-r--r-- | src/server/game/AI/CreatureAI.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp index e3f3cabb5ef..e6d7dc2d1df 100644 --- a/src/server/game/AI/CreatureAI.cpp +++ b/src/server/game/AI/CreatureAI.cpp @@ -21,6 +21,7 @@ #include "Creature.h" #include "CreatureAIImpl.h" #include "CreatureTextMgr.h" +#include "Errors.h" #include "Language.h" #include "Log.h" #include "Map.h" @@ -48,8 +49,11 @@ AISpellInfoType* GetAISpellInfo(uint32 spellId, Difficulty difficulty) return Trinity::Containers::MapGetValuePtr(UnitAI::AISpellInfo, { spellId, difficulty }); } -CreatureAI::CreatureAI(Creature* creature) : UnitAI(creature), me(creature), _boundary(nullptr), _negateBoundary(false), m_MoveInLineOfSight_locked(false) +CreatureAI::CreatureAI(Creature* creature, uint32 scriptId) + : UnitAI(creature), me(creature), _boundary(nullptr), + _negateBoundary(false), _scriptId(scriptId ? scriptId : creature->GetScriptId()), m_MoveInLineOfSight_locked(false) { + ASSERT(_scriptId, "A CreatureAI was initialized with an invalid scriptId!"); } CreatureAI::~CreatureAI() |