refactor(Core/Packets): Rewrite MSG_MINIMAP_PING to modern packet class. (#22696)

This commit is contained in:
Benjamin Jackson
2025-08-19 15:51:06 -04:00
committed by GitHub
parent e0f2ec41ef
commit d4713356a0
6 changed files with 60 additions and 14 deletions
+7 -13
View File
@@ -22,6 +22,7 @@
#include "LFGMgr.h"
#include "Language.h"
#include "Log.h"
#include "MapMgr.h"
#include "MiscPackets.h"
#include "ObjectMgr.h"
#include "Opcodes.h"
@@ -522,24 +523,17 @@ void WorldSession::HandleLootRoll(WorldPacket& recvData)
}
}
void WorldSession::HandleMinimapPingOpcode(WorldPacket& recvData)
void WorldSession::HandleMinimapPingOpcode(WorldPackets::Misc::MinimapPingClient& packet)
{
if (!GetPlayer()->GetGroup())
if (!sMapMgr->IsValidMapCoord(GetPlayer()->GetMap()->GetId(), packet.MapX, packet.MapY))
return;
float x, y;
recvData >> x;
recvData >> y;
Group* group = GetPlayer()->GetGroup();
/** error handling **/
/********************/
if (!group)
return;
// everything's fine, do it
WorldPacket data(MSG_MINIMAP_PING, (8 + 4 + 4));
data << GetPlayer()->GetGUID();
data << float(x);
data << float(y);
GetPlayer()->GetGroup()->BroadcastPacket(&data, true, -1, GetPlayer()->GetGUID());
group->DoMinimapPing(GetPlayer()->GetGUID(), packet.MapX, packet.MapY);
}
void WorldSession::HandleRandomRollOpcode(WorldPackets::Misc::RandomRollClient& packet)