mirror of
https://github.com/ZhengPeiRu21/mod-individual-progression
synced 2025-11-29 23:44:51 +08:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user