diff options
Diffstat (limited to 'src/server/game/Entities')
| -rw-r--r-- | src/server/game/Entities/Creature/GossipDef.cpp | 24 |
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()); } /*********************************************************/ |
