mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 18:40:28 +00:00
Core/Object: Localization objects. (#226)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user