From 65b0f76991801122afe7c651425472a6b8c74e9c Mon Sep 17 00:00:00 2001 From: Sara Date: Sun, 30 Jun 2024 13:23:43 +0200 Subject: [PATCH] chore(style): changed brackets to match style --- src/unit_world_state.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/unit_world_state.cpp b/src/unit_world_state.cpp index f88a376..a84e982 100644 --- a/src/unit_world_state.cpp +++ b/src/unit_world_state.cpp @@ -35,9 +35,8 @@ bool UnitWorldState::get_can_see_target() const { }; // construct list for ignored objects including target node and parent unit gd::TypedArray ignore_list{this->parent_unit->get_rid()}; - if(gd::CollisionObject3D *target_collider{gd::Object::cast_to(this->target_node)}) { + if(gd::CollisionObject3D *target_collider{gd::Object::cast_to(this->target_node)}) ignore_list.push_back(target_collider->get_rid()); - } // construct raycast query from unit's eye node to vision target. Ignoring parent unit and target if applicable gd::Ref const query{gd::PhysicsRayQueryParameters3D::create( eyes.origin, @@ -64,9 +63,8 @@ bool UnitWorldState::get_is_target_dead() const { void UnitWorldState::set_target_node(gd::Node3D *node) { if(node == this->target_node) return; - if(this->target_node != nullptr) { + if(this->target_node != nullptr) this->target_node->disconnect("tree_exited", this->target_node_exited_tree.bind(this->target_node)); - } this->target_node = node; if(node != nullptr) node->connect("tree_exited", this->target_node_exited_tree.bind(node));