mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-13 09:07:19 +00:00
Do not disband alt bots group when master goes away (#702)
* Do not disband alt bots group when master goes away * This update makes the original PR functionality optional, which prevents alternative bots (random bots) from automatically leaving the group when the master leaves. * Fix --------- Co-authored-by: bash <31279994+hermensbas@users.noreply.github.com>
This commit is contained in:
@@ -473,11 +473,11 @@ void PlayerbotHolder::OnBotLogin(Player* const bot)
|
||||
}
|
||||
|
||||
Player* master = botAI->GetMaster();
|
||||
if (!master)
|
||||
if (master)
|
||||
{
|
||||
// Log a warning to indicate that the master is null
|
||||
LOG_DEBUG("mod-playerbots", "Master is null for bot with GUID: {}", bot->GetGUID().GetRawValue());
|
||||
return;
|
||||
ObjectGuid masterGuid = master->GetGUID();
|
||||
if (master->GetGroup() && !master->GetGroup()->IsLeader(masterGuid))
|
||||
master->GetGroup()->ChangeLeader(masterGuid);
|
||||
}
|
||||
|
||||
Group* group = bot->GetGroup();
|
||||
@@ -496,7 +496,10 @@ void PlayerbotHolder::OnBotLogin(Player* const bot)
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
// Don't disband alt groups when master goes away
|
||||
// Controlled by config
|
||||
if (sPlayerbotAIConfig->KeepAltsInGroup())
|
||||
{
|
||||
uint32 account = sCharacterCache->GetCharacterAccountIdByGuid(member);
|
||||
if (!sPlayerbotAIConfig->IsInRandomAccountList(account))
|
||||
|
||||
Reference in New Issue
Block a user