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:
1 parent
dfa1e9532b
commit
6fe19b5a86
65 files changed
+1139
-1132
No files matched your search
@@ -125,7 +125,7 @@ void GameObject::AddToWorld()
|
||||
if (!IsInWorld())
|
||||
{
|
||||
if (m_zoneScript)
|
||||
m_zoneScript->OnGameObjectCreate(this, true);
|
||||
m_zoneScript->OnGameObjectCreate(this);
|
||||
|
||||
sObjectAccessor.AddObject(this);
|
||||
WorldObject::AddToWorld();
|
||||
@@ -138,7 +138,7 @@ void GameObject::RemoveFromWorld()
|
||||
if (IsInWorld())
|
||||
{
|
||||
if (m_zoneScript)
|
||||
m_zoneScript->OnGameObjectCreate(this, false);
|
||||
m_zoneScript->OnGameObjectRemove(this);
|
||||
|
||||
// Possible crash at access to deleted GO in Unit::m_gameobj
|
||||
if (uint64 owner_guid = GetOwnerGUID())
|
||||
|
||||
Reference in new issue
Block a user