mirror of
https://github.com/kadeshar/mod-player-bot-level-brackets.git
synced 2026-02-05 03:53:49 +00:00
Merge pull request #63 from DustinHendrickson/revert-62-feat/ignore_arena_team
Revert "feat: ignore arena team for downgrade" Players reporting this broke processing. Noticed some weird stuff when I re-reviewed it. Reverting.
This commit is contained in:
@@ -120,14 +120,6 @@ BotLevelBrackets.Dynamic.RealPlayerWeight = 1.0
|
|||||||
#
|
#
|
||||||
BotLevelBrackets.Dynamic.SyncFactions = 0
|
BotLevelBrackets.Dynamic.SyncFactions = 0
|
||||||
|
|
||||||
#
|
|
||||||
# BotLevelBrackets.IgnoreArenaTeamBots
|
|
||||||
# Description: Ignore bots that are members of any arena team (prevents downgrades)
|
|
||||||
# Default: 1 (enabled)
|
|
||||||
# Valid values: 0 (off) / 1 (on)
|
|
||||||
#
|
|
||||||
BotLevelBrackets.IgnoreArenaTeamBots = 1
|
|
||||||
|
|
||||||
##############################################
|
##############################################
|
||||||
# Alliance Level Brackets Configuration
|
# Alliance Level Brackets Configuration
|
||||||
##############################################
|
##############################################
|
||||||
|
|||||||
@@ -61,7 +61,6 @@ static bool g_BotDistLiteDebugMode = false;
|
|||||||
static bool g_UseDynamicDistribution = false;
|
static bool g_UseDynamicDistribution = false;
|
||||||
static bool g_IgnoreFriendListed = true;
|
static bool g_IgnoreFriendListed = true;
|
||||||
static uint32 g_FlaggedProcessLimit = 5; // 0 = unlimited
|
static uint32 g_FlaggedProcessLimit = 5; // 0 = unlimited
|
||||||
static bool g_IgnoreArenaTeamBots = true;
|
|
||||||
|
|
||||||
// Real player weight to boost bracket contributions.
|
// Real player weight to boost bracket contributions.
|
||||||
static float g_RealPlayerWeight = 1.0f;
|
static float g_RealPlayerWeight = 1.0f;
|
||||||
@@ -109,7 +108,7 @@ static void LoadBotLevelBracketsConfig()
|
|||||||
{
|
{
|
||||||
g_BotLevelBracketsEnabled = sConfigMgr->GetOption<bool>("BotLevelBrackets.Enabled", true);
|
g_BotLevelBracketsEnabled = sConfigMgr->GetOption<bool>("BotLevelBrackets.Enabled", true);
|
||||||
g_IgnoreGuildBotsWithRealPlayers = sConfigMgr->GetOption<bool>("BotLevelBrackets.IgnoreGuildBotsWithRealPlayers", true);
|
g_IgnoreGuildBotsWithRealPlayers = sConfigMgr->GetOption<bool>("BotLevelBrackets.IgnoreGuildBotsWithRealPlayers", true);
|
||||||
g_IgnoreArenaTeamBots = sConfigMgr->GetOption<bool>("BotLevelBrackets.IgnoreArenaTeamBots", true);
|
|
||||||
g_BotDistFullDebugMode = sConfigMgr->GetOption<bool>("BotLevelBrackets.FullDebugMode", false);
|
g_BotDistFullDebugMode = sConfigMgr->GetOption<bool>("BotLevelBrackets.FullDebugMode", false);
|
||||||
g_BotDistLiteDebugMode = sConfigMgr->GetOption<bool>("BotLevelBrackets.LiteDebugMode", false);
|
g_BotDistLiteDebugMode = sConfigMgr->GetOption<bool>("BotLevelBrackets.LiteDebugMode", false);
|
||||||
g_BotDistCheckFrequency = sConfigMgr->GetOption<uint32>("BotLevelBrackets.CheckFrequency", 300);
|
g_BotDistCheckFrequency = sConfigMgr->GetOption<uint32>("BotLevelBrackets.CheckFrequency", 300);
|
||||||
@@ -202,29 +201,6 @@ static bool IsPlayerBot(Player* player)
|
|||||||
return botAI && botAI->IsBotAI();
|
return botAI && botAI->IsBotAI();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Checks if player is in arena team.
|
|
||||||
*
|
|
||||||
* Checks if player is in arena team
|
|
||||||
*
|
|
||||||
* @param p Pointer to the Player object to check.
|
|
||||||
* @return true if the player is in a team.
|
|
||||||
*/
|
|
||||||
static bool BotInArenaTeam(Player* p)
|
|
||||||
{
|
|
||||||
if (!p || !p->IsInWorld() || !p->GetSession() || p->GetSession()->isLogingOut() || p->IsDuringRemoveFromWorld())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// Check if player is in an arena team
|
|
||||||
for (uint32 arena_slot = 0; arena_slot < MAX_ARENA_SLOT; ++arena_slot)
|
|
||||||
{
|
|
||||||
uint32 arenaTeamId = p->GetArenaTeamId(arena_slot);
|
|
||||||
if (arenaTeamId)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks if the given player is a random bot.
|
* @brief Checks if the given player is a random bot.
|
||||||
@@ -1052,8 +1028,6 @@ static void ProcessPendingLevelResets()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_IgnoreArenaTeamBots && BotInArenaTeam(bot)) { it = g_PendingLevelResets.erase(it); continue; }
|
|
||||||
|
|
||||||
if (bot && bot->IsInWorld() && IsBotSafeForLevelReset(bot))
|
if (bot && bot->IsInWorld() && IsBotSafeForLevelReset(bot))
|
||||||
{
|
{
|
||||||
AdjustBotToRange(bot, targetRange, it->factionRanges);
|
AdjustBotToRange(bot, targetRange, it->factionRanges);
|
||||||
@@ -1305,7 +1279,6 @@ public:
|
|||||||
continue;
|
continue;
|
||||||
if (IsPlayerBot(player))
|
if (IsPlayerBot(player))
|
||||||
continue; // Only count real players.
|
continue; // Only count real players.
|
||||||
if (g_IgnoreArenaTeamBots && BotInArenaTeam(player)) continue;
|
|
||||||
int rangeIndex = GetOrFlagPlayerBracket(player);
|
int rangeIndex = GetOrFlagPlayerBracket(player);
|
||||||
if (rangeIndex < 0)
|
if (rangeIndex < 0)
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user