Core/Misc: Removed old incorrect define

This commit is contained in:
Shauren
2020-04-04 00:28:49 +02:00
parent 1b53a87d49
commit c81de0eb4e
3 changed files with 2 additions and 4 deletions

View File

@@ -97,8 +97,6 @@ enum LocaleConstant : uint8
const uint8 OLD_TOTAL_LOCALES = 9; /// @todo convert in simple system
#define DEFAULT_LOCALE LOCALE_enUS
#define MAX_LOCALES 11
TC_COMMON_API extern char const* localeNames[TOTAL_LOCALES];
TC_COMMON_API LocaleConstant GetLocaleByName(std::string const& name);

View File

@@ -438,7 +438,7 @@ std::string CreatureTextMgr::GetLocalizedChatString(uint32 entry, uint8 gender,
if (groupItr == holderItr->second.end())
return "";
if (locale > MAX_LOCALES)
if (locale >= TOTAL_LOCALES)
locale = DEFAULT_LOCALE;
std::string baseText = "";

View File

@@ -1270,7 +1270,7 @@ public:
std::string itemName = itemNameStr+1;
auto itr = std::find_if(sItemSparseStore.begin(), sItemSparseStore.end(), [&itemName](ItemSparseEntry const* sparse)
{
for (uint32 i = 0; i < MAX_LOCALES; ++i)
for (uint32 i = 0; i < TOTAL_LOCALES; ++i)
if (itemName == sparse->Display->Str[i])
return true;
return false;