From 5f8754123d1f9e8a73ce7270d6d52b0069adf1d8 Mon Sep 17 00:00:00 2001 From: NoxMax <50133316+NoxMax@users.noreply.github.com> Date: Thu, 21 Aug 2025 07:30:52 -0600 Subject: [PATCH] Better error handling when no eligible bots for level login range --- src/RandomPlayerbotMgr.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/RandomPlayerbotMgr.cpp b/src/RandomPlayerbotMgr.cpp index fe3bec81..5bce7949 100644 --- a/src/RandomPlayerbotMgr.cpp +++ b/src/RandomPlayerbotMgr.cpp @@ -360,7 +360,7 @@ void RandomPlayerbotMgr::UpdateAIInternal(uint32 elapsed, bool /*minimal*/) // Cap eligible bots by maxRandomBots uint32 effectiveMaxBots = std::min(eligibleBotCount, sPlayerbotAIConfig->maxRandomBots); - LOG_INFO("playerbots", "Level filter active: {} eligible bots found in range {}-{}. Effective maximum: {} bots", + LOG_INFO("playerbots", "Level filter active: {} eligible bots found in range {}-{}. Effective maximum: {} bots.", eligibleBotCount, sPlayerbotAIConfig->randomBotMinLoginLevel, sPlayerbotAIConfig->randomBotMaxLoginLevel, effectiveMaxBots); @@ -382,8 +382,11 @@ void RandomPlayerbotMgr::UpdateAIInternal(uint32 elapsed, bool /*minimal*/) } else { - LOG_ERROR("playerbots", "No eligible bots found with level filter {}-{}", + LOG_ERROR("playerbots", "No eligible bots found with level filter {}-{}. Change the level range.", sPlayerbotAIConfig->randomBotMinLoginLevel, sPlayerbotAIConfig->randomBotMaxLoginLevel); + SetEventValue(0, "bot_count", 0, 999999999); + maxAllowedBotCount = 0; + currentBots.clear(); levelFilterAdjusted = true; } }