diff options
| author | Shauren <shauren.trinity@gmail.com> | 2016-07-19 19:31:54 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2016-07-19 19:31:54 +0200 |
| commit | 836221aaf5420afe8ff4719780426251c222b87d (patch) | |
| tree | 12a66ff491e38f75bb922c21616b93fd24b85ddf /src/server/game/Chat/ChatLink.cpp | |
| parent | cc07a491f64fa958c8a27079bd2def84c577f816 (diff) | |
| parent | d463273ab1c8efb9dd6000ee5cb8f780574cdd1e (diff) | |
Merge branch 'legion' into 6.x
Diffstat (limited to 'src/server/game/Chat/ChatLink.cpp')
| -rw-r--r-- | src/server/game/Chat/ChatLink.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/server/game/Chat/ChatLink.cpp b/src/server/game/Chat/ChatLink.cpp index 3e523cad4fb..483981261be 100644 --- a/src/server/game/Chat/ChatLink.cpp +++ b/src/server/game/Chat/ChatLink.cpp @@ -19,7 +19,6 @@ #include "SpellMgr.h" #include "ObjectMgr.h" #include "SpellInfo.h" -#include "DBCStores.h" #include "AchievementMgr.h" // Supported shift-links (client generated and server side) @@ -348,18 +347,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; |
