chore: removed debug prints and formatted enemy_world_state.cpp

This commit is contained in:
Sara 2025-03-14 14:22:18 +01:00
parent 4178c08102
commit 1c2522d2ea

View file

@ -23,11 +23,9 @@ void EnemyWorldState::_process(double) {
if(!this->health->is_conscious()) if(!this->health->is_conscious())
return; return;
if(this->select_and_set_target_on_process) { if(this->select_and_set_target_on_process) {
gd::UtilityFunctions::print("!!! ", this->get_path(), " requested, select_and_set_target");
this->select_and_set_target_on_process = false; this->select_and_set_target_on_process = false;
this->select_and_set_target(); this->select_and_set_target();
} else if(!this->parent_unit->has_plan()) { } else if(!this->parent_unit->has_plan()) {
gd::UtilityFunctions::print("!!! ", this->get_path(), " no plan, select_and_set_target");
this->select_and_set_target(); this->select_and_set_target();
} }
} }
@ -41,6 +39,9 @@ void EnemyWorldState::on_awareness_entered(gd::Node3D *node) {
void EnemyWorldState::on_awareness_exited(gd::Node3D *node) { void EnemyWorldState::on_awareness_exited(gd::Node3D *node) {
if(Unit * unit{gd::Object::cast_to<Unit>(node)}) if(Unit * unit{gd::Object::cast_to<Unit>(node)})
this->remove_aware_unit(unit); this->remove_aware_unit(unit);
if(node == this->target_node) {
this->target_node = nullptr;
}
} }
void EnemyWorldState::on_damaged(EntityHealth *, int, Unit *source) { void EnemyWorldState::on_damaged(EntityHealth *, int, Unit *source) {
@ -113,7 +114,6 @@ void EnemyWorldState::on_aware_unit_death(Unit *, Unit *dead_entity) {
} }
void EnemyWorldState::select_and_set_target() { void EnemyWorldState::select_and_set_target() {
gd::UtilityFunctions::print("!!! ", this->get_path(), " select_and_set_target");
this->try_set_target(this->select_target_from_known()); this->try_set_target(this->select_target_from_known());
} }