summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHeartWell <heartwell@list.ru>2016-11-05 19:21:38 +0300
committerShin <borzifrancesco@gmail.com>2016-11-05 17:21:38 +0100
commitb25dbaa96beb050e71df3d476a4e3cfe8eac43b6 (patch)
tree7186a336d72cce333dfda1fc30002487f6689cef /src
parentb8a30dd54372c9651e12fbc0fc3691b751b0562f (diff)
Core/Text: Implemented locales_points_of_interest. (#225)
Diffstat (limited to 'src')
-rw-r--r--src/game/Entities/Creature/GossipDef.cpp8
-rw-r--r--src/game/Globals/ObjectMgr.h6
2 files changed, 13 insertions, 1 deletions
diff --git a/src/game/Entities/Creature/GossipDef.cpp b/src/game/Entities/Creature/GossipDef.cpp
index 731e908af8..264519b9ab 100644
--- a/src/game/Entities/Creature/GossipDef.cpp
+++ b/src/game/Entities/Creature/GossipDef.cpp
@@ -171,13 +171,19 @@ void PlayerMenu::SendPointOfInterest(uint32 poiId) const
return;
}
+ std::string iconText = poi->icon_name;
+ int32 locale = _session->GetSessionDbLocaleIndex();
+ if (locale >= 0)
+ if (PointOfInterestLocale const* localeData = sObjectMgr->GetPointOfInterestLocale(poiId))
+ ObjectMgr::GetLocaleString(localeData->IconName, locale, iconText);
+
WorldPacket data(SMSG_GOSSIP_POI, 4 + 4 + 4 + 4 + 4 + 20); // guess size
data << uint32(poi->flags);
data << float(poi->x);
data << float(poi->y);
data << uint32(poi->icon);
data << uint32(poi->data);
- data << poi->icon_name;
+ data << iconText;
_session->SendPacket(&data);
}
diff --git a/src/game/Globals/ObjectMgr.h b/src/game/Globals/ObjectMgr.h
index fb0b5a811d..d8eb716210 100644
--- a/src/game/Globals/ObjectMgr.h
+++ b/src/game/Globals/ObjectMgr.h
@@ -1074,6 +1074,12 @@ class ObjectMgr
if (itr == _pageTextLocaleStore.end()) return NULL;
return &itr->second;
}
+ PointOfInterestLocale const* GetPointOfInterestLocale(uint32 poi_id) const
+ {
+ PointOfInterestLocaleContainer::const_iterator itr = _pointOfInterestLocaleStore.find(poi_id);
+ if (itr == _pointOfInterestLocaleStore.end()) return NULL;
+ return &itr->second;
+ }
GameObjectData& NewGOData(uint32 guid) { return _gameObjectDataStore[guid]; }
void DeleteGOData(uint32 guid);