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 "CastTimeStrategy.h"
#include "GenericSpellActions.h"
#include "Playerbots.h"
@@ -17,16 +19,17 @@ float CastTimeMultiplier::GetValue(Action* action)
if (!action->GetTarget() || action->GetTarget() != AI_VALUE(Unit*, "current target"))
return 1.0f;
if (/*targetHealth < sPlayerbotAIConfig->criticalHealth && */dynamic_cast<CastSpellAction*>(action))
if (/*targetHealth < sPlayerbotAIConfig->criticalHealth && */ dynamic_cast<CastSpellAction*>(action))
{
uint32 spellId = AI_VALUE2(uint32, "spell id", name);
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
if (!spellInfo)
return 1.0f;
if ((spellInfo->Targets & TARGET_FLAG_DEST_LOCATION) != 0 || (spellInfo->Targets & TARGET_FLAG_SOURCE_LOCATION) != 0)
if ((spellInfo->Targets & TARGET_FLAG_DEST_LOCATION) != 0 ||
(spellInfo->Targets & TARGET_FLAG_SOURCE_LOCATION) != 0)
return 1.0f;
uint32 castTime = spellInfo->CalcCastTime(bot);
if (spellInfo->IsChanneled())
@@ -39,11 +42,13 @@ float CastTimeMultiplier::GetValue(Action* action)
}
Unit* target = action->GetTarget();
if (!target || !target->IsAlive() || !target->IsInWorld()) {
if (!target || !target->IsAlive() || !target->IsInWorld())
{
return 1.0f;
}
if (castTime > (1000 * target->GetHealth() / AI_VALUE(float, "expected group dps"))) {
if (castTime > (1000 * target->GetHealth() / AI_VALUE(float, "expected group dps")))
{
return 0.1f;
}
}
@@ -60,7 +65,7 @@ float CastTimeMultiplier::GetValue(Action* action)
return 1.0f;
}
void CastTimeStrategy::InitMultipliers(std::vector<Multiplier*> &multipliers)
void CastTimeStrategy::InitMultipliers(std::vector<Multiplier*>& multipliers)
{
multipliers.push_back(new CastTimeMultiplier(botAI));
}