From 7f2ba0ed05f695bc110eaf52262d31a4db4a0c35 Mon Sep 17 00:00:00 2001 From: avirar Date: Sat, 16 Nov 2024 10:36:41 +1100 Subject: [PATCH] Fixed issue with random bots not respecting RandomBotFixedLevel (#714) * Update RandomPlayerbotMgr.cpp Added check during random bot login for RandomBotFixedLevel and set PLAYER_FLAGS_NO_XP_GAIN * Update RandomPlayerbotMgr.cpp Removed if from else --- src/RandomPlayerbotMgr.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/RandomPlayerbotMgr.cpp b/src/RandomPlayerbotMgr.cpp index e2fa72f9..f12c83e8 100644 --- a/src/RandomPlayerbotMgr.cpp +++ b/src/RandomPlayerbotMgr.cpp @@ -2243,6 +2243,15 @@ void RandomPlayerbotMgr::OnBotLoginInternal(Player* const bot) { LOG_INFO("playerbots", "{}/{} Bot {} logged in", playerBots.size(), sRandomPlayerbotMgr->GetMaxAllowedBotCount(), bot->GetName().c_str()); + + if (sPlayerbotAIConfig->randomBotFixedLevel) + { + bot->SetPlayerFlag(PLAYER_FLAGS_NO_XP_GAIN); + } + else + { + bot->RemovePlayerFlag(PLAYER_FLAGS_NO_XP_GAIN); + } } void RandomPlayerbotMgr::OnPlayerLogin(Player* player)