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

@@ -36,8 +36,8 @@ uint32 LfgJoinAction::GetRoles()
case CLASS_DRUID:
if (spec == 2)
return PLAYER_ROLE_HEALER;
else if (spec == 1)
return (PLAYER_ROLE_TANK | PLAYER_ROLE_DAMAGE);
else if (spec == 1 && bot->HasAura(16931) /* thick hide */)
return PLAYER_ROLE_TANK;
else
return PLAYER_ROLE_DAMAGE;
break;
@@ -206,6 +206,7 @@ bool LfgAcceptAction::Execute(Event event)
if (bot->IsInCombat() || bot->isDead())
{
/// @FIXME: Race condition
LOG_INFO("playerbots", "Bot {} {}:{} <{}> is in combat and refuses LFG proposal {}",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(),
bot->GetName().c_str(), id);
@@ -219,7 +220,7 @@ bool LfgAcceptAction::Execute(Event event)
botAI->GetAiObjectContext()->GetValue<uint32>("lfg proposal")->Set(0);
bot->ClearUnitState(UNIT_STATE_ALL_STATE);
/// @FIXME: Race condition
sLFGMgr->UpdateProposal(id, bot->GetGUID(), true);
if (sRandomPlayerbotMgr->IsRandomBot(bot) && !bot->GetGroup())

View File

@@ -1583,11 +1583,6 @@ bool MovementAction::MoveAway(Unit* target, float distance, bool backwards)
// just calculates average position of group and runs away from that position
bool MovementAction::MoveFromGroup(float distance)
{
// LOG_ERROR("playerbots", "MovementAction::MoveFromGroup");
//if (Player* master = botAI->GetMaster())
//{
// return MoveAway(master);
//}
if (Group* group = bot->GetGroup())
{
uint32 mapId = bot->GetMapId();