Skip to content

Commit

Permalink
OnAchievementComplete needs to be called earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
Foereaper committed Oct 13, 2023
1 parent 2d0c14d commit 0bbbd38
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/server/game/Achievements/AchievementMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1518,6 +1518,10 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement)
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT, achievement->ID);
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS, achievement->Points);

#ifdef ELUNA
sEluna->OnAchievementComplete(GetPlayer(), achievement->ID);
#endif

// reward items and titles if any
AchievementReward const* reward = sAchievementMgr->GetAchievementReward(achievement);

Expand Down Expand Up @@ -1573,10 +1577,6 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement)
draft.SendMailTo(trans, GetPlayer(), MailSender(MAIL_CREATURE, reward->SenderCreatureId));
CharacterDatabase.CommitTransaction(trans);
}

#ifdef ELUNA
sEluna->OnAchievementComplete(GetPlayer(), achievement->ID);
#endif
}

void AchievementMgr::SendAllAchievementData() const
Expand Down

0 comments on commit 0bbbd38

Please sign in to comment.