mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-09 20:24:16 +00:00
format codebase
This commit is contained in:
@@ -7,22 +7,17 @@
|
||||
#include "dLogger.h"
|
||||
|
||||
|
||||
void VerifyBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* bitStream, BehaviorBranchContext branch)
|
||||
{
|
||||
void VerifyBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* bitStream, BehaviorBranchContext branch) {
|
||||
auto* entity = EntityManager::Instance()->GetEntity(branch.target);
|
||||
|
||||
auto success = true;
|
||||
|
||||
if (entity == nullptr)
|
||||
{
|
||||
if (entity == nullptr) {
|
||||
success = false;
|
||||
}
|
||||
else if (this->m_rangeCheck)
|
||||
{
|
||||
} else if (this->m_rangeCheck) {
|
||||
auto* self = EntityManager::Instance()->GetEntity(context->originator);
|
||||
|
||||
if (self == nullptr)
|
||||
{
|
||||
if (self == nullptr) {
|
||||
Game::logger->Log("VerifyBehavior", "Invalid self for (%llu)", context->originator);
|
||||
|
||||
return;
|
||||
@@ -30,38 +25,31 @@ void VerifyBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* bitS
|
||||
|
||||
const auto distance = Vector3::DistanceSquared(self->GetPosition(), entity->GetPosition());
|
||||
|
||||
if (distance > this->m_range * this->m_range)
|
||||
{
|
||||
if (distance > this->m_range * this->m_range) {
|
||||
success = false;
|
||||
}
|
||||
}
|
||||
else if (this->m_blockCheck)
|
||||
{
|
||||
} else if (this->m_blockCheck) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
if (branch.target != LWOOBJID_EMPTY && branch.target != context->originator)
|
||||
{
|
||||
if (branch.target != LWOOBJID_EMPTY && branch.target != context->originator) {
|
||||
bitStream->Write(success);
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (success) {
|
||||
bitStream->Write<uint32_t>(1);
|
||||
bitStream->Write0();
|
||||
bitStream->Write0();
|
||||
}
|
||||
}
|
||||
|
||||
if (!success)
|
||||
{
|
||||
if (!success) {
|
||||
branch.target = LWOOBJID_EMPTY;
|
||||
}
|
||||
|
||||
m_action->Calculate(context, bitStream, branch);
|
||||
}
|
||||
|
||||
void VerifyBehavior::Load()
|
||||
{
|
||||
void VerifyBehavior::Load() {
|
||||
this->m_rangeCheck = GetBoolean("check_range");
|
||||
|
||||
this->m_blockCheck = GetBoolean("check blocking");
|
||||
|
Reference in New Issue
Block a user