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