Run clang-format

This commit is contained in:
Yunfan Li
2024-08-04 10:23:36 +08:00
parent 44da167492
commit 53611c9040
835 changed files with 35085 additions and 31861 deletions

View File

@@ -1,8 +1,10 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
* and/or modify it under version 2 of the License, or (at your option), any later version.
*/
#include "LeaveGroupAction.h"
#include "Event.h"
#include "PlayerbotAIConfig.h"
#include "Playerbots.h"
@@ -66,7 +68,8 @@ bool UninviteAction::Execute(Event event)
bool LeaveGroupAction::Leave(Player* player)
{
if (player && !GET_PLAYERBOT_AI(player) && !botAI->GetSecurity()->CheckLevelFor(PLAYERBOT_SECURITY_INVITE, false, player))
if (player && !GET_PLAYERBOT_AI(player) &&
!botAI->GetSecurity()->CheckLevelFor(PLAYERBOT_SECURITY_INVITE, false, player))
return false;
bool aiMaster = GET_PLAYERBOT_AI(botAI->GetMaster()) != nullptr;
@@ -95,10 +98,7 @@ bool LeaveGroupAction::Leave(Player* player)
return true;
}
bool LeaveFarAwayAction::Execute(Event event)
{
return Leave(nullptr);
}
bool LeaveFarAwayAction::Execute(Event event) { return Leave(nullptr); }
bool LeaveFarAwayAction::isUseful()
{
@@ -128,7 +128,8 @@ bool LeaveFarAwayAction::isUseful()
if (trueMaster && !GET_PLAYERBOT_AI(trueMaster))
return false;
if (botAI->IsAlt() && (!masterBotAI || masterBotAI->IsRealPlayer())) // Don't leave group when alt grouped with player master.
if (botAI->IsAlt() &&
(!masterBotAI || masterBotAI->IsRealPlayer())) // Don't leave group when alt grouped with player master.
return false;
if (botAI->GetGrouperType() == GrouperType::SOLO)
@@ -154,9 +155,10 @@ bool LeaveFarAwayAction::isUseful()
if (abs(int32(master->GetLevel() - bot->GetLevel())) > 4)
return true;
if (bot->GetMapId() != master->GetMapId() || bot->GetDistance2d(master) >= 2 * sPlayerbotAIConfig->rpgDistance) {
if (bot->GetMapId() != master->GetMapId() || bot->GetDistance2d(master) >= 2 * sPlayerbotAIConfig->rpgDistance)
{
return true;
}
return false;
}