aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2024-07-14 17:28:48 +0200
committerShauren <shauren.trinity@gmail.com>2024-07-14 17:28:48 +0200
commita3aecbdd92000c3338aa14ecfcd3aaca91d99391 (patch)
tree7b77a61cba2fd27e478bc445b14a4a4b2cd57336 /src/server/game/Entities
parentfbc18ff4202290470dbe5e153caf8a634f5bac6f (diff)
Core/PacketIO: Ported SMSG_GOSSIP_POI, CMSG_GROUP_INVITE and SMSG_GROUP_INVITE to packet classes
Diffstat (limited to 'src/server/game/Entities')
-rw-r--r--src/server/game/Entities/Creature/GossipDef.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/server/game/Entities/Creature/GossipDef.cpp b/src/server/game/Entities/Creature/GossipDef.cpp
index 995aad63798..785b8dbe1d9 100644
--- a/src/server/game/Entities/Creature/GossipDef.cpp
+++ b/src/server/game/Entities/Creature/GossipDef.cpp
@@ -17,6 +17,7 @@
#include "GossipDef.h"
#include "Log.h"
+#include "NPCPackets.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "QuestDef.h"
@@ -259,28 +260,27 @@ void PlayerMenu::SendCloseGossip()
void PlayerMenu::SendPointOfInterest(uint32 id) const
{
- PointOfInterest const* poi = sObjectMgr->GetPointOfInterest(id);
- if (!poi)
+ PointOfInterest const* pointOfInterest = sObjectMgr->GetPointOfInterest(id);
+ if (!pointOfInterest)
{
TC_LOG_ERROR("sql.sql", "Request to send non-existing POI (Id: {}), ignored.", id);
return;
}
- std::string name = poi->Name;
+ WorldPackets::NPC::GossipPOI packet;
+ packet.Name = pointOfInterest->Name;
+
LocaleConstant localeConstant = _session->GetSessionDbLocaleIndex();
if (localeConstant != LOCALE_enUS)
if (PointOfInterestLocale const* localeData = sObjectMgr->GetPointOfInterestLocale(id))
- ObjectMgr::GetLocaleString(localeData->Name, localeConstant, name);
+ ObjectMgr::GetLocaleString(localeData->Name, localeConstant, packet.Name);
- WorldPacket data(SMSG_GOSSIP_POI, 4 + 4 + 4 + 4 + 4 + 10); // guess size
- data << uint32(poi->Flags);
- data << float(poi->PositionX);
- data << float(poi->PositionY);
- data << uint32(poi->Icon);
- data << uint32(poi->Importance);
- data << name;
+ packet.Flags = pointOfInterest->Flags;
+ packet.Pos.Pos.Relocate(pointOfInterest->PositionX, pointOfInterest->PositionY);
+ packet.Icon = pointOfInterest->Icon;
+ packet.Importance = pointOfInterest->Importance;
- _session->SendPacket(&data);
+ _session->SendPacket(packet.Write());
}
/*********************************************************/