Permission check and readability improvements (#997)

* AiFactory check by spell instead of level

* Ignore group security for guild invitation
This commit is contained in:
Yunfan Li
2025-02-24 03:09:59 +08:00
committed by GitHub
parent 114eeb3b37
commit 95c2ba9105
5 changed files with 9 additions and 13 deletions

View File

@@ -139,7 +139,7 @@ PlayerbotSecurityLevel PlayerbotSecurity::LevelFor(Player* from, DenyReason* rea
return PLAYERBOT_SECURITY_INVITE;
}
if (group->IsFull())
if (!ignoreGroup && group->IsFull())
{
if (reason)
*reason = PLAYERBOT_DENY_FULL_GROUP;
@@ -147,7 +147,7 @@ PlayerbotSecurityLevel PlayerbotSecurity::LevelFor(Player* from, DenyReason* rea
return PLAYERBOT_SECURITY_TALK;
}
if (group->GetLeaderGUID() != bot->GetGUID())
if (!ignoreGroup && group->GetLeaderGUID() != bot->GetGUID())
{
if (reason)
*reason = PLAYERBOT_DENY_NOT_LEADER;