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
This commit is contained in:
avirar
2024-11-16 10:36:41 +11:00
committed by GitHub
parent 64c1286921
commit 7f2ba0ed05

View File

@@ -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)