Move DestroyObject out of Misc and next to the other object update packets.
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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) +
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user