Core/Scripts: Split OnCreatureCreate() and OnGameObjectCreate() into two virtual functions each.
Note to scripters: be aware that you will need to hook into the Remove functions if you want to do stuff at GO/creature removal. Closes issue 5011. --HG-- branch : trunk
This commit is contained in:
@@ -182,7 +182,7 @@ void Creature::AddToWorld()
|
||||
if (!IsInWorld())
|
||||
{
|
||||
if (m_zoneScript)
|
||||
m_zoneScript->OnCreatureCreate(this, true);
|
||||
m_zoneScript->OnCreatureCreate(this);
|
||||
sObjectAccessor.AddObject(this);
|
||||
Unit::AddToWorld();
|
||||
SearchFormation();
|
||||
@@ -197,7 +197,7 @@ void Creature::RemoveFromWorld()
|
||||
if (IsInWorld())
|
||||
{
|
||||
if (m_zoneScript)
|
||||
m_zoneScript->OnCreatureCreate(this, false);
|
||||
m_zoneScript->OnCreatureRemove(this);
|
||||
if (m_formation)
|
||||
formation_mgr.RemoveCreatureFromGroup(m_formation, this);
|
||||
Unit::RemoveFromWorld();
|
||||
|
||||
Reference in New Issue
Block a user