Core/Object: Localization objects. (#226)

This commit is contained in:
HeartWell
2016-11-05 22:43:11 +03:00
committed by Shin
parent f54f7ce7dc
commit c8cc99be37
6 changed files with 157456 additions and 16 deletions

View File

@@ -551,6 +551,34 @@ public:
GameObjectTemplateContainer const* gotc = sObjectMgr->GetGameObjectTemplates();
for (GameObjectTemplateContainer::const_iterator itr = gotc->begin(); itr != gotc->end(); ++itr)
{
uint8 localeIndex = handler->GetSessionDbLocaleIndex();
if (GameObjectLocale const* objectLocalte = sObjectMgr->GetGameObjectLocale(itr->second.entry))
{
if (objectLocalte->Name.size() > localeIndex && !objectLocalte->Name[localeIndex].empty())
{
std::string name = objectLocalte->Name[localeIndex];
if (Utf8FitTo(name, wNamePart))
{
if (maxResults && count++ == maxResults)
{
handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
return true;
}
if (handler->GetSession())
handler->PSendSysMessage(LANG_GO_ENTRY_LIST_CHAT, itr->second.entry, itr->second.entry, name.c_str());
else
handler->PSendSysMessage(LANG_GO_ENTRY_LIST_CONSOLE, itr->second.entry, name.c_str());
if (!found)
found = true;
continue;
}
}
}
std::string name = itr->second.name;
if (name.empty())
continue;