summaryrefslogtreecommitdiff
path: root/src/scripts/Commands/cs_lookup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/scripts/Commands/cs_lookup.cpp')
-rw-r--r--src/scripts/Commands/cs_lookup.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/scripts/Commands/cs_lookup.cpp b/src/scripts/Commands/cs_lookup.cpp
index fda4b5e7c6..d81ce581da 100644
--- a/src/scripts/Commands/cs_lookup.cpp
+++ b/src/scripts/Commands/cs_lookup.cpp
@@ -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;