From fea17276062792c26cf321c5a1a1701e00010cf6 Mon Sep 17 00:00:00 2001 From: sogladev Date: Fri, 14 Nov 2025 14:12:12 +0100 Subject: [PATCH] fix(Core/Achievements): a character can only have 1 race realm first (#23626) --- src/server/game/Achievements/AchievementMgr.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 1e615b6d5..2451aac3d 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -1826,6 +1826,15 @@ bool AchievementMgr::IsCompletedCriteria(AchievementCriteriaEntry const* achieve // someone on this realm has already completed that achievement if (sAchievementMgr->IsRealmCompleted(achievement)) return false; + + // A character may only have 1 race-specific 'Realm First!' achievement + // prevent clever use of the race/faction change service to obtain multiple 'Realm First!' achievements + constexpr std::array raceSpecificRealmFirstAchievements { 1405, 1406, 1407, 1408, 1409, 1410, 1411, 1412, 1413 }; + bool isRaceSpecific = std::ranges::find(raceSpecificRealmFirstAchievements, achievement->ID) != std::ranges::end(raceSpecificRealmFirstAchievements); + if (isRaceSpecific) + for (uint32 raceAchievementId : raceSpecificRealmFirstAchievements) + if (raceAchievementId != achievement->ID && HasAchieved(raceAchievementId)) + return false; } // pussywizard: progress will be deleted after getting the achievement (optimization)