diff options
author | joschiwald <joschiwald.trinity@gmail.com> | 2017-06-04 15:05:11 +0200 |
---|---|---|
committer | joschiwald <joschiwald.trinity@gmail.com> | 2017-06-04 15:05:11 +0200 |
commit | 69e9ac882740b2e9c1b3dba27e6dbc934dde30dd (patch) | |
tree | 8072b13de8affa322911bc3969dec92f0c9f217e /src/server/game/Chat/ChatLink.cpp | |
parent | c7cae32cfc89c422fae7d3ecef4902c6818f9849 (diff) |
Core/Misc: Fixed warnings
Diffstat (limited to 'src/server/game/Chat/ChatLink.cpp')
-rw-r--r-- | src/server/game/Chat/ChatLink.cpp | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/server/game/Chat/ChatLink.cpp b/src/server/game/Chat/ChatLink.cpp index b2f6986cc69..a783327a64b 100644 --- a/src/server/game/Chat/ChatLink.cpp +++ b/src/server/game/Chat/ChatLink.cpp @@ -382,24 +382,17 @@ bool ItemChatLink::ValidateName(char* buffer, char const* context) LocalizedString* suffixStrings = _suffix ? _suffix->Name : (_property ? _property->Name : nullptr); - bool res = (FormatName(LOCALE_enUS, suffixStrings) == buffer); - if (!res) + for (uint8 locale = LOCALE_enUS; locale < TOTAL_LOCALES; ++locale) { - for (uint8 index = LOCALE_koKR; index < TOTAL_LOCALES; ++index) - { - if (index == LOCALE_none) - continue; + if (locale == LOCALE_none) + continue; - if (FormatName(index, suffixStrings) == buffer) - { - res = true; - break; - } - } + if (FormatName(locale, suffixStrings) == buffer) + return true; } - if (!res) - TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): linked item (id: %u) name wasn't found in any localization", context, _item->GetId()); - return res; + + TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): linked item (id: %u) name wasn't found in any localization", context, _item->GetId()); + return false; } // |color|Hquest:quest_id:quest_level|h[name]|h|r |