mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-17 10:45:43 +00:00
Permission check and readability improvements (#997)
* AiFactory check by spell instead of level * Ignore group security for guild invitation
This commit is contained in:
@@ -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())
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user