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,28 +1,31 @@
/*
* 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 "AttackerCountValues.h"
#include "Playerbots.h"
#include "SharedDefines.h"
uint8 MyAttackerCountValue::Calculate()
{
return bot->getAttackers().size();
}
uint8 MyAttackerCountValue::Calculate() { return bot->getAttackers().size(); }
bool HasAggroValue::Calculate()
{
Unit* target = GetTarget();
if (!target) {
if (!target)
{
return true;
}
Unit* victim = target->GetVictim();
if (!victim) {
if (!victim)
{
return true;
}
bool isMT = botAI->IsMainTank(bot);
if (victim && (victim->GetGUID() == bot->GetGUID() || (!isMT && victim->ToPlayer() && botAI->IsTank(victim->ToPlayer())))) {
if (victim &&
(victim->GetGUID() == bot->GetGUID() || (!isMT && victim->ToPlayer() && botAI->IsTank(victim->ToPlayer()))))
{
return true;
}
return false;
@@ -33,7 +36,7 @@ uint8 AttackerCountValue::Calculate()
uint32 count = 0;
float range = sPlayerbotAIConfig->sightDistance;
GuidVector attackers = context->GetValue<GuidVector >("attackers")->Get();
GuidVector attackers = context->GetValue<GuidVector>("attackers")->Get();
for (ObjectGuid const guid : attackers)
{
Unit* unit = botAI->GetUnit(guid);
@@ -50,15 +53,14 @@ uint8 AttackerCountValue::Calculate()
uint8 BalancePercentValue::Calculate()
{
float playerLevel = 0,
attackerLevel = 0;
float playerLevel = 0, attackerLevel = 0;
if (Group* group = bot->GetGroup())
{
Group::MemberSlotList const& groupSlot = group->GetMemberSlots();
for (Group::member_citerator itr = groupSlot.begin(); itr != groupSlot.end(); itr++)
{
Player *player = ObjectAccessor::FindPlayer(itr->guid);
Player* player = ObjectAccessor::FindPlayer(itr->guid);
if (!player || !player->IsAlive())
continue;