Core/Scripting: Delay zone script's OnCreatureCreate until the creature has been added to map stores
Port From (https://github.com/TrinityCore/TrinityCore/commit/d57e74b3b592536ffd32a92a342eb0abc6e05e62)
This commit is contained in:
@@ -63,9 +63,6 @@ namespace Game.Entities
|
||||
// Register the creature for guid lookup
|
||||
if (!IsInWorld)
|
||||
{
|
||||
if (m_zoneScript != null)
|
||||
m_zoneScript.OnCreatureCreate(this);
|
||||
|
||||
GetMap().GetObjectsStore().Add(GetGUID(), this);
|
||||
if (m_spawnId != 0)
|
||||
GetMap().GetCreatureBySpawnIdStore().Add(m_spawnId, this);
|
||||
@@ -75,6 +72,9 @@ namespace Game.Entities
|
||||
InitializeAI();
|
||||
if (IsVehicle())
|
||||
GetVehicleKit().Install();
|
||||
|
||||
if (m_zoneScript != null)
|
||||
m_zoneScript.OnCreatureCreate(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user