Core/Misc: Fixed array out of bounds access when loading locales_achievement_reward, locales_creature_text, locales_gossip_menu_option and skip LOCALE_none when iterating over locales

This commit is contained in:
Shauren
2016-01-24 15:08:49 +01:00
parent d5b0ffbe9b
commit 11ad71e2fc
5 changed files with 25 additions and 5 deletions

View File

@@ -185,7 +185,7 @@ void CreatureTextMgr::LoadCreatureTextLocales()
{
Field* fields = result->Fetch();
CreatureTextLocale& loc = mLocaleTextMap[CreatureTextId(fields[0].GetUInt32(), uint32(fields[1].GetUInt8()), uint32(fields[2].GetUInt8()))];
for (uint8 i = TOTAL_LOCALES - 1; i > 0; --i)
for (uint8 i = OLD_TOTAL_LOCALES - 1; i > 0; --i)
{
LocaleConstant locale = LocaleConstant(i);
ObjectMgr::AddLocaleString(fields[3 + i - 1].GetString(), locale, loc.Text);