From 62e298e4bf5f0397a2b648673d206602aa42d982 Mon Sep 17 00:00:00 2001 From: Grimfeather <88028633+Grimfeather@users.noreply.github.com> Date: Sat, 10 May 2025 03:21:03 +0200 Subject: [PATCH] another check for playerbots hopefully the last fix needed to solve the issue with playerbots not getting nerfed when the bot account is added to isExcludedFromProgression --- src/IndividualProgression.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/IndividualProgression.cpp b/src/IndividualProgression.cpp index 5c37971..b362fdc 100644 --- a/src/IndividualProgression.cpp +++ b/src/IndividualProgression.cpp @@ -23,6 +23,17 @@ bool IndividualProgression::isBeforeProgression(Player* player, ProgressionState return player->GetPlayerSetting("mod-individual-progression", SETTING_PROGRESSION_STATE).value < state; } +bool isExcludedFromProgression(Player* player) +{ + if(!sIndividualProgression->excludeAccounts) { + return false; + } + std::string accountName; + bool accountNameFound = AccountMgr::GetName(player->GetSession()->GetAccountId(), accountName); + std::regex excludedAccountsRegex (sIndividualProgression->excludedAccountsRegex); + return (accountNameFound && std::regex_match(accountName, excludedAccountsRegex)); +} + void IndividualProgression::UpdateProgressionState(Player* player, ProgressionState newState) const { if (progressionLimit && newState > progressionLimit) @@ -45,11 +56,11 @@ void IndividualProgression::CheckAdjustments(Player* player) const { return; } - if (!hasPassedProgression(player, PROGRESSION_NAXX40)) + if ((!hasPassedProgression(player, PROGRESSION_NAXX40)) || (isExcludedFromProgression(player) && (player->GetLevel() < 61))) { AdjustVanillaStats(player); } - else if (!hasPassedProgression(player, PROGRESSION_TBC_TIER_5)) + else if ((!hasPassedProgression(player, PROGRESSION_TBC_TIER_5)) || (isExcludedFromProgression(player) && (player->GetLevel() < 71))) { AdjustTBCStats(player); }