diff options
| author | Treeston <treeston.mmoc@gmail.com> | 2018-02-12 03:25:05 +0100 |
|---|---|---|
| committer | Treeston <treeston.mmoc@gmail.com> | 2018-02-12 03:25:05 +0100 |
| commit | e4e6e2209c8ad6cc534460a4ec9f6da469761d15 (patch) | |
| tree | dbb0ce8865c132636208ad2b0328b3f99e6051ae | |
| parent | f6bf9bc04ddb4e310a6086a6081b1d4b3455fc6d (diff) | |
Core/AI: EscortAI init logic moved from JustAppeared to InitializeAI. There are no escort NPCs using compatibility mode anymore, so this is equivalent.
As a result, inheriting scripts calling Start in on-create hooks (like JustSummoned) will now work properly again.
Tagging #20310.
| -rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp | 4 | ||||
| -rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedEscortAI.h | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index 504226a2c2a..1a61a9dc6a9 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -72,7 +72,7 @@ void EscortAI::JustDied(Unit* /*killer*/) } } -void EscortAI::JustAppeared() +void EscortAI::InitializeAI() { _escortState = STATE_ESCORT_NONE; @@ -84,8 +84,6 @@ void EscortAI::JustAppeared() if (me->GetFaction() != me->GetCreatureTemplate()->faction) me->RestoreFaction(); - - Reset(); } void EscortAI::ReturnToLastPoint() diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h index 883262c459d..cb4fa0e84fa 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h @@ -40,9 +40,9 @@ struct TC_GAME_API EscortAI : public ScriptedAI explicit EscortAI(Creature* creature); ~EscortAI() { } + void InitializeAI() override; void MoveInLineOfSight(Unit* who) override; void JustDied(Unit*) override; - void JustAppeared() override; void ReturnToLastPoint(); void EnterEvadeMode(EvadeReason /*why*/ = EVADE_REASON_OTHER) override; void MovementInform(uint32, uint32) override; |
