Move DestroyObject out of Misc and next to the other object update packets.

This commit is contained in:
schell244
2026-09-15 16:42:43 +02:00
parent a24c48f3d3
commit ec0e9ebc87
6 changed files with 23 additions and 23 deletions
+1 -1
View File
@@ -498,7 +498,7 @@ void Object::DestroyForPlayer(Player const* target) const
{
MANGOS_ASSERT(target);
auto packet = std::make_unique<WorldPackets::Misc::DestroyObject>();
auto packet = std::make_unique<WorldPackets::ObjectUpdate::DestroyObject>();
packet->objectGuid = GetObjectGuid();
target->GetSession()->SendPacket(std::move(packet));
}
+2 -2
View File
@@ -1836,7 +1836,7 @@ bool Player::SwitchInstance(uint32 newInstanceId)
for (const auto& guid : m_visibleGUIDs)
{
auto packet = std::make_unique<WorldPackets::Misc::DestroyObject>();
auto packet = std::make_unique<WorldPackets::ObjectUpdate::DestroyObject>();
packet->objectGuid = guid;
GetSession()->SendPacket(std::move(packet));
}
@@ -21740,7 +21740,7 @@ void Player::SendDestroyGroupMembers(bool includingSelf)
{
if (!includingSelf && itr.guid == GetObjectGuid())
continue;
auto packet = std::make_unique<WorldPackets::Misc::DestroyObject>();
auto packet = std::make_unique<WorldPackets::ObjectUpdate::DestroyObject>();
packet->objectGuid = itr.guid;
GetSession()->SendPacket(std::move(packet));
m_visibleGUIDs.erase(itr.guid);
-10
View File
@@ -612,16 +612,6 @@ void WorldPackets::Misc::InvalidatePlayer::AppendBodyTo(ByteBuffer& buffer) cons
}
#endif
size_t WorldPackets::Misc::DestroyObject::EstimateFinalSize() const
{
return sizeof(objectGuid);
}
void WorldPackets::Misc::DestroyObject::AppendBodyTo(ByteBuffer& buffer) const
{
buffer << objectGuid;
}
size_t WorldPackets::Misc::AiReaction::EstimateFinalSize() const
{
return sizeof(unitGuid) +
-10
View File
@@ -685,16 +685,6 @@ namespace WorldPackets { namespace Misc
};
#endif
class DestroyObject final : public ServerPacket
{
public:
ObjectGuid objectGuid; // guid of the object to destroy
explicit DestroyObject() : ServerPacket(SMSG_DESTROY_OBJECT) {}
size_t EstimateFinalSize() const override;
void AppendBodyTo(ByteBuffer& buffer) const override;
};
class AiReaction final : public ServerPacket
{
public:
+10
View File
@@ -5,6 +5,16 @@
#include "World.h"
#include <zlib.h>
size_t WorldPackets::ObjectUpdate::DestroyObject::EstimateFinalSize() const
{
return sizeof(objectGuid);
}
void WorldPackets::ObjectUpdate::DestroyObject::AppendBodyTo(ByteBuffer& buffer) const
{
buffer << objectGuid;
}
size_t WorldPackets::ObjectUpdate::UpdateObject::EstimateFinalSize() const
{
// The size depends on whether the packet ends up compressed, so
+10
View File
@@ -7,6 +7,16 @@
namespace WorldPackets { namespace ObjectUpdate
{
class DestroyObject final : public ServerPacket
{
public:
ObjectGuid objectGuid; // guid of the object to destroy
explicit DestroyObject() : ServerPacket(SMSG_DESTROY_OBJECT) {}
size_t EstimateFinalSize() const override;
void AppendBodyTo(ByteBuffer& buffer) const override;
};
class UpdateObject final : public ServerPacket
{
public: