diff options
| author | Shauren <shauren.trinity@gmail.com> | 2016-01-24 15:56:10 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2016-05-20 23:46:17 +0200 |
| commit | 5c2c9a684f1458da0cea1f3536622add77ef1324 (patch) | |
| tree | d3a2a349e8bed9a31cf417ce93830d508ecea46b /src/server/game/Chat/ChatLink.cpp | |
| parent | 65c0a0ee4d5c299f3caab04b6cb3fcd7a4a93e2e (diff) | |
Core/DataStores: Updated dbc/db2 to 7.0.1.20810
Diffstat (limited to 'src/server/game/Chat/ChatLink.cpp')
| -rw-r--r-- | src/server/game/Chat/ChatLink.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/server/game/Chat/ChatLink.cpp b/src/server/game/Chat/ChatLink.cpp index 3e523cad4fb..c11c25219a5 100644 --- a/src/server/game/Chat/ChatLink.cpp +++ b/src/server/game/Chat/ChatLink.cpp @@ -348,18 +348,23 @@ bool SpellChatLink::ValidateName(char* buffer, const char* context) return false; } - uint32 skillLineNameLength = strlen(skillLine->DisplayName_lang); - if (skillLineNameLength > 0 && strncmp(skillLine->DisplayName_lang, buffer, skillLineNameLength) == 0) + for (uint8 i = 0; i < TOTAL_LOCALES; ++i) { - // found the prefix, remove it to perform spellname validation below - // -2 = strlen(": ") - uint32 spellNameLength = strlen(buffer) - skillLineNameLength - 2; - memmove(buffer, buffer + skillLineNameLength + 2, spellNameLength + 1); + uint32 skillLineNameLength = strlen(skillLine->DisplayName->Str[i]); + if (skillLineNameLength > 0 && strncmp(skillLine->DisplayName->Str[i], buffer, skillLineNameLength) == 0) + { + // found the prefix, remove it to perform spellname validation below + // -2 = strlen(": ") + uint32 spellNameLength = strlen(buffer) - skillLineNameLength - 2; + memmove(buffer, buffer + skillLineNameLength + 2, spellNameLength + 1); + break; + } } } - if (*_spell->SpellName && strcmp(_spell->SpellName, buffer) == 0) - return true; + for (uint8 i = 0; i < TOTAL_LOCALES; ++i) + if (*_spell->SpellName->Str[i] && strcmp(_spell->SpellName->Str[i], buffer) == 0) + return true; TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): linked spell (id: %u) name wasn't found in any localization", context, _spell->Id); return false; |
