aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Chat/ChatLink.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Chat/ChatLink.cpp')
-rw-r--r--src/server/game/Chat/ChatLink.cpp23
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