Core/Objects: Properly choose between "Destroyed" or "OutOfRange" during visibility update
Port From (https://github.com/TrinityCore/TrinityCore/commit/5a82a0381d704e4b4b9976daf04d541d1130e541)
This commit is contained in:
@@ -6071,7 +6071,11 @@ namespace Game.Entities
|
||||
if (target.IsTypeId(TypeId.Unit))
|
||||
BeforeVisibilityDestroy(target.ToCreature(), this);
|
||||
|
||||
target.DestroyForPlayer(this);
|
||||
if (!target.IsDestroyedObject())
|
||||
target.SendOutOfRangeForPlayer(this);
|
||||
else
|
||||
target.DestroyForPlayer(this);
|
||||
|
||||
m_clientGUIDs.Remove(target.GetGUID());
|
||||
}
|
||||
}
|
||||
@@ -6097,7 +6101,11 @@ namespace Game.Entities
|
||||
{
|
||||
BeforeVisibilityDestroy(target, this);
|
||||
|
||||
target.BuildOutOfRangeUpdateBlock(data);
|
||||
if (!target.IsDestroyedObject())
|
||||
target.BuildOutOfRangeUpdateBlock(data);
|
||||
else
|
||||
target.BuildDestroyUpdateBlock(data);
|
||||
|
||||
m_clientGUIDs.Remove(target.GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user