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:
hondacrx
2022-03-09 12:33:25 -05:00
parent 510a1a0208
commit e65a1e95cf
6 changed files with 31 additions and 10 deletions
+10 -2
View File
@@ -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());
}
}