removeFromGroup replaced with worldpackets

This commit is contained in:
bash
2025-10-05 20:05:56 +02:00
parent 377ac199a7
commit 1faf20f567
5 changed files with 69 additions and 58 deletions

View File

@@ -70,10 +70,12 @@ bool UninviteAction::Execute(Event event)
return false;
}
bool LeaveGroupAction::Leave(Player* player)
static bool LeaveGroupAction::Leave(Player* player)
{
if (player && !GET_PLAYERBOT_AI(player) &&
if (player &&
!botAI &&
!botAI->GetSecurity()->CheckLevelFor(PLAYERBOT_SECURITY_INVITE, false, player))
return false;
bool aiMaster = GET_PLAYERBOT_AI(botAI->GetMaster()) != nullptr;
@@ -84,7 +86,7 @@ bool LeaveGroupAction::Leave(Player* player)
bool shouldStay = randomBot && bot->GetGroup() && player == bot;
if (!shouldStay)
{
bot->RemoveFromGroup();
botAI->RemoveFromGroup();
}
if (randomBot)