mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 01:37:37 +01:00
[8103] More wide use IsInWorld checks and delayed at teleport operations. Author: Ambal
* IsInWorld used to prevent return unexpected not in world objects.
* Delayed operations need to process its in world state.
--HG--
branch : trunk
This commit is contained in:
@@ -76,7 +76,13 @@ void GameObject::CleanupsBeforeDelete()
|
||||
// Possible crash at access to deleted GO in Unit::m_gameobj
|
||||
if(uint64 owner_guid = GetOwnerGUID())
|
||||
{
|
||||
if(Unit* owner = ObjectAccessor::GetUnit(*this,owner_guid))
|
||||
Unit* owner = NULL;
|
||||
if(IS_PLAYER_GUID(owner_guid))
|
||||
owner = ObjectAccessor::GetObjectInWorld(owner_guid, (Player*)NULL);
|
||||
else
|
||||
owner = ObjectAccessor::GetUnit(*this,owner_guid);
|
||||
|
||||
if(owner)
|
||||
owner->RemoveGameObject(this,false);
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user