diff options
| author | Az@zel <azazel.kon@gmail.com> | 2011-05-11 11:12:26 +0600 |
|---|---|---|
| committer | Az@zel <azazel.kon@gmail.com> | 2011-05-11 11:12:26 +0600 |
| commit | f73c6c40bb707b5af920f322e8b8bfde27308d4c (patch) | |
| tree | d8284693ea4cbd0f4d888c19cdb7493776fe34cb /src/server/game/Chat/Commands | |
| parent | 09fb6f555f5cd8bd41b396e3fcc58b7cdc071925 (diff) | |
Core/Misc: fix compiler warnings
Diffstat (limited to 'src/server/game/Chat/Commands')
| -rwxr-xr-x | src/server/game/Chat/Commands/Level3.cpp | 70 |
1 files changed, 32 insertions, 38 deletions
diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index af8e5e8859f..e5a351fb05e 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -1230,32 +1230,29 @@ bool ChatHandler::HandleLookupCreatureCommand(const char *args) { uint32 id = itr->second.Entry; uint8 localeIndex = GetSessionDbLocaleIndex(); - if (localeIndex >= 0) + if (CreatureLocale const *cl = sObjectMgr->GetCreatureLocale(id)) { - if (CreatureLocale const *cl = sObjectMgr->GetCreatureLocale(id)) + if (cl->Name.size() > localeIndex && !cl->Name[localeIndex].empty ()) { - if (cl->Name.size() > localeIndex && !cl->Name[localeIndex].empty ()) - { - std::string name = cl->Name[localeIndex]; + std::string name = cl->Name[localeIndex]; - if (Utf8FitTo (name, wnamepart)) + if (Utf8FitTo (name, wnamepart)) + { + if (maxResults && count++ == maxResults) { - if (maxResults && count++ == maxResults) - { - PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults); - return true; - } + PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults); + return true; + } - if (m_session) - PSendSysMessage (LANG_CREATURE_ENTRY_LIST_CHAT, id, id, name.c_str ()); - else - PSendSysMessage (LANG_CREATURE_ENTRY_LIST_CONSOLE, id, name.c_str ()); + if (m_session) + PSendSysMessage (LANG_CREATURE_ENTRY_LIST_CHAT, id, id, name.c_str ()); + else + PSendSysMessage (LANG_CREATURE_ENTRY_LIST_CONSOLE, id, name.c_str ()); - if (!found) - found = true; + if (!found) + found = true; - continue; - } + continue; } } } @@ -1310,32 +1307,29 @@ bool ChatHandler::HandleLookupObjectCommand(const char *args) for (GameObjectTemplateContainer::const_iterator itr = gotc->begin(); itr != gotc->end(); ++itr) { uint8 localeIndex = GetSessionDbLocaleIndex(); - if (localeIndex >= 0) + if (GameObjectLocale const *gl = sObjectMgr->GetGameObjectLocale(itr->second.entry)) { - if (GameObjectLocale const *gl = sObjectMgr->GetGameObjectLocale(itr->second.entry)) + if (gl->Name.size() > localeIndex && !gl->Name[localeIndex].empty()) { - if (gl->Name.size() > localeIndex && !gl->Name[localeIndex].empty()) - { - std::string name = gl->Name[localeIndex]; + std::string name = gl->Name[localeIndex]; - if (Utf8FitTo(name, wnamepart)) + if (Utf8FitTo(name, wnamepart)) + { + if (maxResults && count++ == maxResults) { - if (maxResults && count++ == maxResults) - { - PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults); - return true; - } + PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults); + return true; + } - if (m_session) - PSendSysMessage(LANG_GO_ENTRY_LIST_CHAT, itr->second.entry, itr->second.entry, name.c_str()); - else - PSendSysMessage(LANG_GO_ENTRY_LIST_CONSOLE, itr->second.entry, name.c_str()); + if (m_session) + PSendSysMessage(LANG_GO_ENTRY_LIST_CHAT, itr->second.entry, itr->second.entry, name.c_str()); + else + PSendSysMessage(LANG_GO_ENTRY_LIST_CONSOLE, itr->second.entry, name.c_str()); - if (!found) - found = true; + if (!found) + found = true; - continue; - } + continue; } } } |
