mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-23 05:36:23 +00:00
fix(core/Creature): initialize AI before calling OnCreatureCreate
This commit is contained in:
@@ -222,13 +222,11 @@ void Creature::AddToWorld()
|
||||
// it's also initialized in AIM_Initialize(), few lines below, but it's not a problem
|
||||
Motion_Initialize();
|
||||
|
||||
if (GetZoneScript())
|
||||
GetZoneScript()->OnCreatureCreate(this);
|
||||
|
||||
GetMap()->GetObjectsStore().Insert<Creature>(GetGUID(), this);
|
||||
if (m_spawnId)
|
||||
{
|
||||
GetMap()->GetCreatureBySpawnIdStore().insert(std::make_pair(m_spawnId, this));
|
||||
|
||||
}
|
||||
Unit::AddToWorld();
|
||||
|
||||
SearchFormation();
|
||||
@@ -236,7 +234,14 @@ void Creature::AddToWorld()
|
||||
AIM_Initialize();
|
||||
|
||||
if (IsVehicle())
|
||||
{
|
||||
GetVehicleKit()->Install();
|
||||
}
|
||||
|
||||
if (GetZoneScript())
|
||||
{
|
||||
GetZoneScript()->OnCreatureCreate(this);
|
||||
}
|
||||
#ifdef ELUNA
|
||||
sEluna->OnAddToWorld(this);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user