diff options
Diffstat (limited to 'src/server/game/Achievements/AchievementMgr.cpp')
| -rw-r--r-- | src/server/game/Achievements/AchievementMgr.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 9c26fd6e91..2451aac3d9 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -1,14 +1,14 @@ /* * This file is part of the AzerothCore Project. See AUTHORS file for Copyright information * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU Affero General Public License as published by the - * Free Software Foundation; either version 3 of the License, or (at your - * option) any later version. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along @@ -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<uint32, 9> 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) |
