mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-30 13:47:23 +01:00
Core/Scripting: Delay zone script's OnCreatureCreate until the creature has been added to map stores
(cherry picked from commit b4a1887c4d)
This commit is contained in:
@@ -323,9 +323,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));
|
||||
@@ -335,6 +332,9 @@ void Creature::AddToWorld()
|
||||
AIM_Initialize();
|
||||
if (IsVehicle())
|
||||
GetVehicleKit()->Install();
|
||||
|
||||
if (GetZoneScript())
|
||||
GetZoneScript()->OnCreatureCreate(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user