FIX: Battlegrounds - Remove bot's master when master left the BG and group

Adds a check for if current master left the BG and group,  if so release set master and carry on in BG.

This prevents multiple bots in (potentially multiple different) BG's to still consider you as their master when you yourself have left.
This commit is contained in:
SaW 2025-11-07 19:51:36 +01:00 committed by GitHub
parent e5bc495dbe
commit e2c40b7ff9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -367,7 +367,13 @@ void PlayerbotAI::UpdateAIGroupAndMaster()
{
if (!bot)
return;
PlayerbotAI* botAI = GET_PLAYERBOT_AI(bot);
if (!botAI)
return;
Group* group = bot->GetGroup();
// If bot is not in group verify that for is RandomBot before clearing master and resetting.
if (!group)
{
@ -380,12 +386,9 @@ void PlayerbotAI::UpdateAIGroupAndMaster()
return;
}
if (bot->InBattleground() && bot->GetBattleground()->GetBgTypeID() != BATTLEGROUND_AV)
return;
PlayerbotAI* botAI = GET_PLAYERBOT_AI(bot);
if (!botAI)
return;
// Bot in BG, but master no longer part of a group: release master
if (bot->InBattleground() && master && !master->GetGroup())
SetMaster(nullptr);
PlayerbotAI* masterBotAI = nullptr;
if (master)