fix(core/Creature): initialize AI before calling OnCreatureCreate
This commit is contained in:
parent
8b47540745
commit
863455736e
1 changed files with 9 additions and 4 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue