aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2020-04-04 00:28:49 +0200
committerShauren <shauren.trinity@gmail.com>2020-04-04 00:28:49 +0200
commitc81de0eb4ed858e82d44cb59fb524f89e5925f49 (patch)
treeb8f31fda1557198aacf2f5f2fa31c11a9fbc74d1
parent1b53a87d498c54609e0975bb0ef3a310b6729c9b (diff)
Core/Misc: Removed old incorrect define
-rw-r--r--src/common/Common.h2
-rw-r--r--src/server/game/Texts/CreatureTextMgr.cpp2
-rw-r--r--src/server/scripts/Commands/cs_misc.cpp2
3 files changed, 2 insertions, 4 deletions
diff --git a/src/common/Common.h b/src/common/Common.h
index 3518d1cb628..7f76698c9c9 100644
--- a/src/common/Common.h
+++ b/src/common/Common.h
@@ -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);
diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp
index 6febfd49362..78e96e12492 100644
--- a/src/server/game/Texts/CreatureTextMgr.cpp
+++ b/src/server/game/Texts/CreatureTextMgr.cpp
@@ -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 = "";
diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp
index 87f2e1125f7..1067283431d 100644
--- a/src/server/scripts/Commands/cs_misc.cpp
+++ b/src/server/scripts/Commands/cs_misc.cpp
@@ -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;