mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-24 22:26:22 +00:00
Core/Item: Localization items. (#223)
This commit is contained in:
@@ -372,6 +372,38 @@ public:
|
||||
ItemTemplateContainer const* its = sObjectMgr->GetItemTemplateStore();
|
||||
for (ItemTemplateContainer::const_iterator itr = its->begin(); itr != its->end(); ++itr)
|
||||
{
|
||||
int localeIndex = handler->GetSessionDbLocaleIndex();
|
||||
if (localeIndex >= 0)
|
||||
{
|
||||
uint8 ulocaleIndex = uint8(localeIndex);
|
||||
if (ItemLocale const* il = sObjectMgr->GetItemLocale(itr->second.ItemId))
|
||||
{
|
||||
if (il->Name.size() > ulocaleIndex && !il->Name[ulocaleIndex].empty())
|
||||
{
|
||||
std::string name = il->Name[ulocaleIndex];
|
||||
|
||||
if (Utf8FitTo(name, wNamePart))
|
||||
{
|
||||
if (maxResults && count++ == maxResults)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (handler->GetSession())
|
||||
handler->PSendSysMessage(LANG_ITEM_LIST_CHAT, itr->second.ItemId, itr->second.ItemId, name.c_str());
|
||||
else
|
||||
handler->PSendSysMessage(LANG_ITEM_LIST_CONSOLE, itr->second.ItemId, name.c_str());
|
||||
|
||||
if (!found)
|
||||
found = true;
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::string name = itr->second.Name1;
|
||||
if (name.empty())
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user