aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2018-08-29 13:55:49 +0200
committerTreeston <treeston.mmoc@gmail.com>2018-08-29 13:55:49 +0200
commitb4a1887c4d8df5a7729ed5c4126f6a7655a02127 (patch)
treea10a748a9296ae6892ee491be4fb3130c1d274fc /src
parentbb953328ee8c4d6a628327ae98731f79c713de24 (diff)
Core/Scripting: Delay zone script's OnCreatureCreate until the creature has been added to map stores
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Creature/Creature.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index 32430e22962..9f73e458080 100644
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -277,9 +277,6 @@ void Creature::AddToWorld()
///- Register the creature for guid lookup
if (!IsInWorld())
{
- if (GetZoneScript())
- GetZoneScript()->OnCreatureCreate(this);
-
GetMap()->GetObjectsStore().Insert<Creature>(GetGUID(), this);
if (m_spawnId)
GetMap()->GetCreatureBySpawnIdStore().insert(std::make_pair(m_spawnId, this));
@@ -291,6 +288,9 @@ void Creature::AddToWorld()
AIM_Initialize();
if (IsVehicle())
GetVehicleKit()->Install();
+
+ if (GetZoneScript())
+ GetZoneScript()->OnCreatureCreate(this);
}
}