aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2018-02-12 03:25:05 +0100
committerShauren <shauren.trinity@gmail.com>2021-06-19 23:33:38 +0200
commitf4cc76063f5c19773e25eaac9bd3975828c4cc47 (patch)
tree23a4b01ad3c8d369b41ee290171374546c1c9696 /src
parent3c172ba17cc707fad0730356310e8afe68bcf261 (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. (cherry picked from commit e4e6e2209c8ad6cc534460a4ec9f6da469761d15)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp4
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedEscortAI.h2
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 bcdf801075c..bb118886b79 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
@@ -69,7 +69,7 @@ void EscortAI::JustDied(Unit* /*killer*/)
}
}
-void EscortAI::JustAppeared()
+void EscortAI::InitializeAI()
{
_escortState = STATE_ESCORT_NONE;
@@ -81,8 +81,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 fe8f6eb37fb..69bd4b5f6f3 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h
+++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h
@@ -39,9 +39,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;