mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-19 03:45:43 +00:00
fix(CORE/locale): achievement_reward_locale should now work (#2811)
Closes #2810
This commit is contained in:
@@ -2219,8 +2219,23 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement)
|
||||
MailDraft draft(reward->mailTemplate);
|
||||
|
||||
if (!reward->mailTemplate)
|
||||
draft = MailDraft(reward->subject, reward->text);
|
||||
|
||||
{
|
||||
std::string subject = reward->subject;
|
||||
std::string text = reward->text;
|
||||
|
||||
LocaleConstant localeConstant = GetPlayer()->GetSession()->GetSessionDbLocaleIndex();
|
||||
if (localeConstant != LOCALE_enUS)
|
||||
{
|
||||
if(AchievementRewardLocale const* loc = sAchievementMgr->GetAchievementRewardLocale(achievement))
|
||||
{
|
||||
ObjectMgr::GetLocaleString(loc->Subject, localeConstant, subject);
|
||||
ObjectMgr::GetLocaleString(loc->Text, localeConstant, text);
|
||||
}
|
||||
}
|
||||
|
||||
draft = MailDraft(subject, text);
|
||||
}
|
||||
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
Item* item = reward->itemId ? Item::CreateItem(reward->itemId, 1, GetPlayer()) : NULL;
|
||||
|
||||
Reference in New Issue
Block a user