mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-02-20 18:10:02 +01:00
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:
parent
e5bc495dbe
commit
e2c40b7ff9
@ -367,7 +367,13 @@ void PlayerbotAI::UpdateAIGroupAndMaster()
|
|||||||
{
|
{
|
||||||
if (!bot)
|
if (!bot)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
PlayerbotAI* botAI = GET_PLAYERBOT_AI(bot);
|
||||||
|
if (!botAI)
|
||||||
|
return;
|
||||||
|
|
||||||
Group* group = bot->GetGroup();
|
Group* group = bot->GetGroup();
|
||||||
|
|
||||||
// If bot is not in group verify that for is RandomBot before clearing master and resetting.
|
// If bot is not in group verify that for is RandomBot before clearing master and resetting.
|
||||||
if (!group)
|
if (!group)
|
||||||
{
|
{
|
||||||
@ -380,12 +386,9 @@ void PlayerbotAI::UpdateAIGroupAndMaster()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bot->InBattleground() && bot->GetBattleground()->GetBgTypeID() != BATTLEGROUND_AV)
|
// Bot in BG, but master no longer part of a group: release master
|
||||||
return;
|
if (bot->InBattleground() && master && !master->GetGroup())
|
||||||
|
SetMaster(nullptr);
|
||||||
PlayerbotAI* botAI = GET_PLAYERBOT_AI(bot);
|
|
||||||
if (!botAI)
|
|
||||||
return;
|
|
||||||
|
|
||||||
PlayerbotAI* masterBotAI = nullptr;
|
PlayerbotAI* masterBotAI = nullptr;
|
||||||
if (master)
|
if (master)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user