format codebase

This commit is contained in:
aronwk-aaron
2022-07-28 08:39:57 -05:00
parent 4f7aa11067
commit 19e77a38d8
881 changed files with 34700 additions and 38689 deletions

View File

@@ -9,8 +9,7 @@
#include "DestroyableComponent.h"
void StunBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitStream, const BehaviorBranchContext branch)
{
void StunBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitStream, const BehaviorBranchContext branch) {
if (this->m_stunCaster || branch.target == context->originator) {
return;
}
@@ -20,8 +19,7 @@ void StunBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitStream
auto* target = EntityManager::Instance()->GetEntity(branch.target);
if (target == nullptr)
{
if (target == nullptr) {
Game::logger->Log("StunBehavior", "Failed to find target (%llu)!", branch.target);
return;
@@ -33,22 +31,18 @@ void StunBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitStream
auto* combatAiComponent = static_cast<BaseCombatAIComponent*>(target->GetComponent(COMPONENT_TYPE_BASE_COMBAT_AI));
if (combatAiComponent == nullptr)
{
if (combatAiComponent == nullptr) {
return;
}
combatAiComponent->Stun(branch.duration);
}
void StunBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* bitStream, const BehaviorBranchContext branch)
{
if (this->m_stunCaster || branch.target == context->originator)
{
void StunBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* bitStream, const BehaviorBranchContext branch) {
if (this->m_stunCaster || branch.target == context->originator) {
auto* self = EntityManager::Instance()->GetEntity(context->originator);
if (self == nullptr)
{
if (self == nullptr) {
Game::logger->Log("StunBehavior", "Invalid self entity (%llu)!", context->originator);
return;
@@ -60,8 +54,7 @@ void StunBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* bitStr
auto* combatAiComponent = static_cast<BaseCombatAIComponent*>(self->GetComponent(COMPONENT_TYPE_BASE_COMBAT_AI));
if (combatAiComponent == nullptr)
{
if (combatAiComponent == nullptr) {
return;
}
@@ -74,20 +67,17 @@ void StunBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* bitStr
auto* target = EntityManager::Instance()->GetEntity(branch.target);
if (target != nullptr)
{
if (target != nullptr) {
auto* destroyableComponent = target->GetComponent<DestroyableComponent>();
if (destroyableComponent != nullptr)
{
if (destroyableComponent != nullptr) {
blocked = destroyableComponent->IsKnockbackImmune();
}
}
bitStream->Write(blocked);
if (target == nullptr)
{
if (target == nullptr) {
Game::logger->Log("StunBehavior", "Failed to find target (%llu)!", branch.target);
return;
@@ -99,15 +89,13 @@ void StunBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* bitStr
auto* combatAiComponent = static_cast<BaseCombatAIComponent*>(target->GetComponent(COMPONENT_TYPE_BASE_COMBAT_AI));
if (combatAiComponent == nullptr)
{
if (combatAiComponent == nullptr) {
return;
}
combatAiComponent->Stun(branch.duration);
}
void StunBehavior::Load()
{
void StunBehavior::Load() {
this->m_stunCaster = GetBoolean("stun_caster");
}