mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +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
|
// it's also initialized in AIM_Initialize(), few lines below, but it's not a problem
|
||||||
Motion_Initialize();
|
Motion_Initialize();
|
||||||
|
|
||||||
if (GetZoneScript())
|
|
||||||
GetZoneScript()->OnCreatureCreate(this);
|
|
||||||
|
|
||||||
GetMap()->GetObjectsStore().Insert<Creature>(GetGUID(), this);
|
GetMap()->GetObjectsStore().Insert<Creature>(GetGUID(), this);
|
||||||
if (m_spawnId)
|
if (m_spawnId)
|
||||||
|
{
|
||||||
GetMap()->GetCreatureBySpawnIdStore().insert(std::make_pair(m_spawnId, this));
|
GetMap()->GetCreatureBySpawnIdStore().insert(std::make_pair(m_spawnId, this));
|
||||||
|
}
|
||||||
Unit::AddToWorld();
|
Unit::AddToWorld();
|
||||||
|
|
||||||
SearchFormation();
|
SearchFormation();
|
||||||
@@ -236,7 +234,14 @@ void Creature::AddToWorld()
|
|||||||
AIM_Initialize();
|
AIM_Initialize();
|
||||||
|
|
||||||
if (IsVehicle())
|
if (IsVehicle())
|
||||||
|
{
|
||||||
GetVehicleKit()->Install();
|
GetVehicleKit()->Install();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GetZoneScript())
|
||||||
|
{
|
||||||
|
GetZoneScript()->OnCreatureCreate(this);
|
||||||
|
}
|
||||||
#ifdef ELUNA
|
#ifdef ELUNA
|
||||||
sEluna->OnAddToWorld(this);
|
sEluna->OnAddToWorld(this);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user