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.cpp21
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;