mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 10:26:28 +01:00
Core/DataStores: Simplified string memory allocation in db2 files, dropped unneccessary level of indirection
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user