mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-06 10:44:08 +00:00
format codebase
This commit is contained in:
@@ -7,12 +7,10 @@
|
||||
#include "dLogger.h"
|
||||
#include "DestroyableComponent.h"
|
||||
|
||||
void ImmunityBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitStream, const BehaviorBranchContext branch)
|
||||
{
|
||||
void ImmunityBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitStream, const BehaviorBranchContext branch) {
|
||||
auto* target = EntityManager::Instance()->GetEntity(branch.target);
|
||||
|
||||
if (target == nullptr)
|
||||
{
|
||||
if (target == nullptr) {
|
||||
Game::logger->Log("DamageAbsorptionBehavior", "Failed to find target (%llu)!", branch.target);
|
||||
|
||||
return;
|
||||
@@ -20,13 +18,11 @@ void ImmunityBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitSt
|
||||
|
||||
auto* destroyable = static_cast<DestroyableComponent*>(target->GetComponent(COMPONENT_TYPE_DESTROYABLE));
|
||||
|
||||
if (destroyable == nullptr)
|
||||
{
|
||||
if (destroyable == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this->m_immuneBasicAttack)
|
||||
{
|
||||
if (!this->m_immuneBasicAttack) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -35,17 +31,14 @@ void ImmunityBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitSt
|
||||
context->RegisterTimerBehavior(this, branch, target->GetObjectID());
|
||||
}
|
||||
|
||||
void ImmunityBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* bitStream, BehaviorBranchContext branch)
|
||||
{
|
||||
void ImmunityBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* bitStream, BehaviorBranchContext branch) {
|
||||
Handle(context, bitStream, branch);
|
||||
}
|
||||
|
||||
void ImmunityBehavior::Timer(BehaviorContext* context, BehaviorBranchContext branch, const LWOOBJID second)
|
||||
{
|
||||
void ImmunityBehavior::Timer(BehaviorContext* context, BehaviorBranchContext branch, const LWOOBJID second) {
|
||||
auto* target = EntityManager::Instance()->GetEntity(second);
|
||||
|
||||
if (target == nullptr)
|
||||
{
|
||||
if (target == nullptr) {
|
||||
Game::logger->Log("DamageAbsorptionBehavior", "Failed to find target (%llu)!", second);
|
||||
|
||||
return;
|
||||
@@ -53,15 +46,13 @@ void ImmunityBehavior::Timer(BehaviorContext* context, BehaviorBranchContext bra
|
||||
|
||||
auto* destroyable = static_cast<DestroyableComponent*>(target->GetComponent(COMPONENT_TYPE_DESTROYABLE));
|
||||
|
||||
if (destroyable == nullptr)
|
||||
{
|
||||
if (destroyable == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
destroyable->PopImmunity();
|
||||
}
|
||||
|
||||
void ImmunityBehavior::Load()
|
||||
{
|
||||
void ImmunityBehavior::Load() {
|
||||
this->m_immuneBasicAttack = GetBoolean("immune_basic_attack");
|
||||
}
|
||||
|
Reference in New Issue
Block a user