chore: removed unneeded print calls

This commit is contained in:
Sara 2024-08-05 13:21:52 +02:00
parent 5abab18a86
commit 693859e874
2 changed files with 2 additions and 11 deletions

View file

@ -25,7 +25,6 @@ void EnemyWorldState::_ready() { GDGAMEONLY();
void EnemyWorldState::on_awareness_entered(gd::Node3D *node) { void EnemyWorldState::on_awareness_entered(gd::Node3D *node) {
if(Unit *unit{gd::Object::cast_to<Unit>(node)}) { if(Unit *unit{gd::Object::cast_to<Unit>(node)}) {
gd::UtilityFunctions::print("!!! ", this->get_path(), ": ", node->get_path(), " entered awareness");
this->add_aware_unit(unit); this->add_aware_unit(unit);
} }
} }
@ -72,9 +71,6 @@ void EnemyWorldState::add_aware_unit(Unit *unit) {
this->known_enemies.insert(0, unit); this->known_enemies.insert(0, unit);
if(!this->parent_unit->has_plan()) if(!this->parent_unit->has_plan())
this->try_set_target(this->select_target_from_known()); 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) { 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) { void EnemyWorldState::set_editor_available_goals(gd::Array array) {
this->available_goals.clear(); this->available_goals.clear();
while(!array.is_empty()) { for(int i{0}; i < array.size(); ++i)
gd::Ref<goap::Goal> goal{array.pop_front()}; this->available_goals.push_back(array[i]);
this->available_goals.push_back(goal);
}
} }
gd::Array EnemyWorldState::get_editor_available_goals() const { gd::Array EnemyWorldState::get_editor_available_goals() const {

View file

@ -25,12 +25,9 @@ void UnitWorldState::_bind_methods() {
void UnitWorldState::_enter_tree() { GDGAMEONLY(); void UnitWorldState::_enter_tree() { GDGAMEONLY();
this->parent_unit = gd::Object::cast_to<Unit>(this->get_parent()); this->parent_unit = gd::Object::cast_to<Unit>(this->get_parent());
gd::UtilityFunctions::print("!!! ", this->get_path(), ": is part of ", this->parent_unit->get_path());
this->agent = this->get_node<gd::NavigationAgent3D>("%NavigationAgent3D"); this->agent = this->get_node<gd::NavigationAgent3D>("%NavigationAgent3D");
this->eye_location = this->get_node<gd::Node3D>("%Eyes"); this->eye_location = this->get_node<gd::Node3D>("%Eyes");
this->health = this->get_node<EntityHealth>("%EntityHealth"); this->health = this->get_node<EntityHealth>("%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 { bool UnitWorldState::get_can_see_target() const {