From 693859e874f8f6bd468e8ae987a746a5e60d6611 Mon Sep 17 00:00:00 2001 From: Sara Date: Mon, 5 Aug 2024 13:21:52 +0200 Subject: [PATCH] chore: removed unneeded print calls --- src/enemy_world_state.cpp | 10 ++-------- src/unit_world_state.cpp | 3 --- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/enemy_world_state.cpp b/src/enemy_world_state.cpp index 01b5ec9..13d59b8 100644 --- a/src/enemy_world_state.cpp +++ b/src/enemy_world_state.cpp @@ -25,7 +25,6 @@ void EnemyWorldState::_ready() { GDGAMEONLY(); void EnemyWorldState::on_awareness_entered(gd::Node3D *node) { if(Unit *unit{gd::Object::cast_to(node)}) { - gd::UtilityFunctions::print("!!! ", this->get_path(), ": ", node->get_path(), " entered awareness"); this->add_aware_unit(unit); } } @@ -72,9 +71,6 @@ void EnemyWorldState::add_aware_unit(Unit *unit) { this->known_enemies.insert(0, unit); if(!this->parent_unit->has_plan()) this->try_set_target(this->select_target_from_known()); - else - gd::UtilityFunctions::print("!!! ", this->get_path(), " not replanning because a plan is already in motion"); - gd::UtilityFunctions::print("!!! ", this->get_path(), " found ", unit->get_path()); } void EnemyWorldState::remove_aware_unit(Unit *unit) { @@ -126,10 +122,8 @@ void EnemyWorldState::try_set_target(Unit *unit) { void EnemyWorldState::set_editor_available_goals(gd::Array array) { this->available_goals.clear(); - while(!array.is_empty()) { - gd::Ref goal{array.pop_front()}; - this->available_goals.push_back(goal); - } + for(int i{0}; i < array.size(); ++i) + this->available_goals.push_back(array[i]); } gd::Array EnemyWorldState::get_editor_available_goals() const { diff --git a/src/unit_world_state.cpp b/src/unit_world_state.cpp index 3d4997d..3904027 100644 --- a/src/unit_world_state.cpp +++ b/src/unit_world_state.cpp @@ -25,12 +25,9 @@ void UnitWorldState::_bind_methods() { void UnitWorldState::_enter_tree() { GDGAMEONLY(); this->parent_unit = gd::Object::cast_to(this->get_parent()); - gd::UtilityFunctions::print("!!! ", this->get_path(), ": is part of ", this->parent_unit->get_path()); this->agent = this->get_node("%NavigationAgent3D"); this->eye_location = this->get_node("%Eyes"); this->health = this->get_node("%EntityHealth"); - if(this->parent_unit == nullptr) - gd::UtilityFunctions::push_warning("UnitWorldState needs to be a child node of a Unit"); } bool UnitWorldState::get_can_see_target() const {