leave group when leader is randombot

This commit is contained in:
Yunfan Li
2023-08-04 23:23:21 +08:00
parent 6f8a8d9253
commit 9598719801

View File

@@ -891,6 +891,11 @@ bool RandomPlayerbotMgr::ProcessBot(Player* player)
return false;
}
Group* group = player->GetGroup();
if (group && !group->isLFGGroup() && IsRandomBot(group->GetLeader())) {
player->RemoveFromGroup();
LOG_INFO("playerbots", "Bot {} remove from group since leader is random bot.", player->GetName().c_str());
}
//GET_PLAYERBOT_AI(player)->GetAiObjectContext()->GetValue<bool>("random bot update")->Set(false);
// bool randomiser = true;
@@ -922,17 +927,6 @@ bool RandomPlayerbotMgr::ProcessBot(Player* player)
uint32 randomTime = urand(sPlayerbotAIConfig->minRandomBotRandomizeTime, sPlayerbotAIConfig->maxRandomBotRandomizeTime);
ScheduleRandomize(bot, randomTime);
return true;
// if (randomiser)
// {
// }
// else
// {
// LOG_INFO("playerbots", "Bot #{} {}:{} {} <{}>: consumables refreshed", bot, player->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", player->getLevel(), player->GetName(), sGuildMgr->GetGuildById(player->GetGuildId())->GetName());
// }
// if (sPlayerbotAIConfig->autoDoQuests)
// ChangeStrategyOnce(player);
// else
// ChangeStrategy(player);
}
// enable random teleport logic if no auto traveling enabled