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
This commit is contained in:
Grimfeather
2025-05-10 03:21:03 +02:00
committed by GitHub
parent 5e54f844d9
commit 62e298e4bf

View File

@@ -23,6 +23,17 @@ bool IndividualProgression::isBeforeProgression(Player* player, ProgressionState
return player->GetPlayerSetting("mod-individual-progression", SETTING_PROGRESSION_STATE).value < state; 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 void IndividualProgression::UpdateProgressionState(Player* player, ProgressionState newState) const
{ {
if (progressionLimit && newState > progressionLimit) if (progressionLimit && newState > progressionLimit)
@@ -45,11 +56,11 @@ void IndividualProgression::CheckAdjustments(Player* player) const
{ {
return; return;
} }
if (!hasPassedProgression(player, PROGRESSION_NAXX40)) if ((!hasPassedProgression(player, PROGRESSION_NAXX40)) || (isExcludedFromProgression(player) && (player->GetLevel() < 61)))
{ {
AdjustVanillaStats(player); 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); AdjustTBCStats(player);
} }