Core/PacketIO: Properly destroy objects clientside when removing from world

Port From (https://github.com/TrinityCore/TrinityCore/commit/38cc011af04ebc7edff74f1ed4edfde9d1d77e0b)
This commit is contained in:
hondacrx
2020-02-09 17:10:01 -05:00
parent a4096ebd0c
commit 96fd9b7a57
3 changed files with 30 additions and 14 deletions
+6 -1
View File
@@ -224,6 +224,11 @@ namespace Game.Entities
data.AddUpdateBlock(buffer);
}
void BuildDestroyUpdateBlock(UpdateData data)
{
data.AddDestroyObject(GetGUID());
}
public void BuildOutOfRangeUpdateBlock(UpdateData data)
{
data.AddOutOfRangeGUID(GetGUID());
@@ -232,7 +237,7 @@ namespace Game.Entities
public virtual void DestroyForPlayer(Player target)
{
UpdateData updateData = new UpdateData(target.GetMapId());
BuildOutOfRangeUpdateBlock(updateData);
BuildDestroyUpdateBlock(updateData);
UpdateObject packet;
updateData.BuildPacket(out packet);
target.SendPacket(packet);