dont apply XPRate if bot is in group with real player

https://github.com/liyunfan1223/mod-playerbots/issues/1490
This commit is contained in:
bash
2025-08-02 16:50:55 +02:00
committed by GitHub
parent ee99b66d04
commit fa005ac1a9

View File

@@ -215,6 +215,20 @@ public:
if (!sRandomPlayerbotMgr->IsRandomBot(player))
return;
// if player in group check leader is real player.
if (Group* group = player->GetGroup())
{
Player* leader = group->GetLeader();
if (leader != player)
{
if (!player->GetSession()->IsBot())
return;
if (!sRandomPlayerbotMgr->IsRandomBot(player))
return;
}
}
if (sPlayerbotAIConfig->randomBotXPRate != 1.0)
{
amount = static_cast<uint32>(std::round(static_cast<float>(amount) * sPlayerbotAIConfig->randomBotXPRate));