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