From deca201f7787f31187e2b9fab9cba7760313e786 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 27 Jun 2020 13:33:17 +0200 Subject: Core/DataStores: Simplified string memory allocation in db2 files, dropped unneccessary level of indirection --- src/server/game/Chat/ChatLink.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/server/game/Chat/ChatLink.cpp') diff --git a/src/server/game/Chat/ChatLink.cpp b/src/server/game/Chat/ChatLink.cpp index d9f28c0b987..5e17714555c 100644 --- a/src/server/game/Chat/ChatLink.cpp +++ b/src/server/game/Chat/ChatLink.cpp @@ -496,10 +496,10 @@ bool SpellChatLink::ValidateName(char* buffer, char const* context) return false; } - for (uint8 i = 0; i < TOTAL_LOCALES; ++i) + for (LocaleConstant i = LOCALE_enUS; i < TOTAL_LOCALES; i = LocaleConstant(i + 1)) { - uint32 skillLineNameLength = strlen(skillLine->DisplayName->Str[i]); - if (skillLineNameLength > 0 && strncmp(skillLine->DisplayName->Str[i], buffer, skillLineNameLength) == 0) + uint32 skillLineNameLength = strlen(skillLine->DisplayName[i]); + if (skillLineNameLength > 0 && strncmp(skillLine->DisplayName[i], buffer, skillLineNameLength) == 0) { // found the prefix, remove it to perform spellname validation below // -2 = strlen(": ") @@ -567,12 +567,12 @@ bool AchievementChatLink::ValidateName(char* buffer, char const* context) { ChatLink::ValidateName(buffer, context); - for (uint8 locale = LOCALE_enUS; locale < TOTAL_LOCALES; ++locale) + for (LocaleConstant locale = LOCALE_enUS; locale < TOTAL_LOCALES; locale = LocaleConstant(locale + 1)) { if (locale == LOCALE_none) continue; - if (strcmp(_achievement->Title->Str[locale], buffer) == 0) + if (strcmp(_achievement->Title[locale], buffer) == 0) return true; } -- cgit v1.2.3