aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.cpp15
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.h5
2 files changed, 13 insertions, 7 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp
index e0c0e43d388..acbd5888aa9 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.cpp
+++ b/src/server/game/AI/SmartScripts/SmartAI.cpp
@@ -515,12 +515,6 @@ void SmartAI::InitializeAI()
me->SetVisible(true);
- if (!me->isDead())
- {
- GetScript()->ProcessEventsFor(SMART_EVENT_RESPAWN);
- GetScript()->OnReset();
- }
-
_followGUID.Clear(); // do not reset follower on Reset(), we need it after combat evade
_followDistance = 0;
_followAngle = 0;
@@ -530,6 +524,15 @@ void SmartAI::InitializeAI()
_followCreditType = 0;
}
+void SmartAI::JustAppeared()
+{
+ if (me->isDead())
+ return;
+
+ GetScript()->ProcessEventsFor(SMART_EVENT_RESPAWN);
+ GetScript()->OnReset();
+}
+
void SmartAI::JustReachedHome()
{
GetScript()->OnReset();
diff --git a/src/server/game/AI/SmartScripts/SmartAI.h b/src/server/game/AI/SmartScripts/SmartAI.h
index 6deb81c0f50..fa3af7b9549 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.h
+++ b/src/server/game/AI/SmartScripts/SmartAI.h
@@ -133,9 +133,12 @@ class TC_GAME_API SmartAI : public CreatureAI
// Called when a Player/Creature enters the creature (vehicle)
void PassengerBoarded(Unit* who, int8 seatId, bool apply) override;
- // Called when gets initialized, when creature is added to world
+ // Called when gets initialized
void InitializeAI() override;
+ // Called once creature is fully added to world
+ void JustAppeared() override;
+
// Called when creature gets charmed by another unit
void OnCharmed(bool isNew) override;