mirror of
https://github.com/kadeshar/mod-player-bot-level-brackets.git
synced 2026-01-13 01:08:36 +00:00
Setting up separate branch for IgnoreFriends option by itself
This commit is contained in:
@@ -3,12 +3,6 @@
|
||||
##############################################
|
||||
# mod-player-bot-level-brackets configuration
|
||||
##############################################
|
||||
# BotLevelBrackets.ModEnabled
|
||||
# Description: Turns module on/on
|
||||
# Default: 1 (enabled)
|
||||
# Valid Values: 0 (off) / 1 (on)
|
||||
BotLevelBrackets.ModEnabled = 1
|
||||
|
||||
#
|
||||
# BotLevelBrackets.DebugMode
|
||||
# Description: Enables debug logging for the Bot Level Brackets module.
|
||||
|
||||
@@ -51,7 +51,6 @@ static uint32 g_BotDistFlaggedCheckFrequency = 15; // in seconds
|
||||
static bool g_BotDistDebugMode = false;
|
||||
static bool g_UseDynamicDistribution = false;
|
||||
static bool g_IgnoreFriendListed = true;
|
||||
static bool g_EnableMod = true;
|
||||
|
||||
// Real player weight to boost bracket contributions.
|
||||
static float g_RealPlayerWeight = 1.0f;
|
||||
@@ -65,7 +64,6 @@ static void LoadBotLevelBracketsConfig()
|
||||
g_UseDynamicDistribution = sConfigMgr->GetOption<bool>("BotLevelBrackets.UseDynamicDistribution", false);
|
||||
g_RealPlayerWeight = sConfigMgr->GetOption<float>("BotLevelBrackets.RealPlayerWeight", 1.0f);
|
||||
g_IgnoreFriendListed = sConfigMgr->GetOption<bool>("BotLevelBrackets.IgnoreFriendListed", true);
|
||||
g_EnableMod = sConfigMgr->GetOption<bool>("BotLevelBrackets.ModEnabled", true);
|
||||
|
||||
// Load the bot level restrictions.
|
||||
g_RandomBotMinLevel = static_cast<uint8>(sConfigMgr->GetOption<uint32>("AiPlayerbot.RandomBotMinLevel", 1));
|
||||
@@ -99,8 +97,6 @@ static void LoadBotLevelBracketsConfig()
|
||||
// Returns the index of the level range bracket that the given level belongs to.
|
||||
// If the bot is out of range, it returns -1
|
||||
static int GetLevelRangeIndex(uint8 level, uint8 teamID)
|
||||
{
|
||||
if (g_EnableMod)
|
||||
{
|
||||
// If the bot's level is outside the allowed global bounds, signal an invalid bracket.
|
||||
if (level < g_RandomBotMinLevel || level > g_RandomBotMaxLevel)
|
||||
@@ -126,7 +122,6 @@ static int GetLevelRangeIndex(uint8 level, uint8 teamID)
|
||||
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
// Returns a random level within the provided range.
|
||||
static uint8 GetRandomLevelInRange(const LevelRangeConfig& range)
|
||||
@@ -242,8 +237,6 @@ static void LogAllBotLevels()
|
||||
}
|
||||
|
||||
static void ClampAndBalanceBrackets()
|
||||
{
|
||||
if (g_EnableMod)
|
||||
{
|
||||
// First, adjust Alliance brackets.
|
||||
for (uint8 i = 0; i < NUM_RANGES; ++i)
|
||||
@@ -314,7 +307,6 @@ static void ClampAndBalanceBrackets()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// SAFETY CHECKS FOR LEVEL RESET
|
||||
@@ -403,7 +395,7 @@ static void ProcessPendingLevelResets()
|
||||
Player* bot = it->bot;
|
||||
int targetRange = it->targetRange;
|
||||
|
||||
if (bot && bot->IsInWorld() && IsBotSafeForLevelReset(bot) && g_EnableMod)
|
||||
if (bot && bot->IsInWorld() && IsBotSafeForLevelReset(bot))
|
||||
{
|
||||
AdjustBotToRange(bot, targetRange, it->factionRanges);
|
||||
LOG_INFO("server.loading", "[BotLevelBrackets] Bot '{}' successfully reset to level range {}-{}.",
|
||||
@@ -504,8 +496,6 @@ public:
|
||||
}
|
||||
|
||||
void OnUpdate(uint32 diff) override
|
||||
{
|
||||
if (g_EnableMod)
|
||||
{
|
||||
m_timer += diff;
|
||||
m_flaggedTimer += diff;
|
||||
@@ -1054,7 +1044,6 @@ public:
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 m_timer; // For distribution adjustments
|
||||
|
||||
Reference in New Issue
Block a user