diff options
| author | Treeston <treeston.mmoc@gmail.com> | 2018-08-29 13:55:49 +0200 |
|---|---|---|
| committer | Treeston <treeston.mmoc@gmail.com> | 2018-08-29 13:55:49 +0200 |
| commit | b4a1887c4d8df5a7729ed5c4126f6a7655a02127 (patch) | |
| tree | a10a748a9296ae6892ee491be4fb3130c1d274fc /src | |
| parent | bb953328ee8c4d6a628327ae98731f79c713de24 (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.cpp | 6 |
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); } } |
