fix: body/area_entered only registered if !ready
This commit is contained in:
parent
4efcf58a01
commit
c66d6f56b4
|
|
@ -33,9 +33,11 @@ void DamageBox::_notification(int what) {
|
|||
default:
|
||||
return;
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
connect("body_entered", callable_mp(this, &self_type::on_body_entered));
|
||||
connect("area_entered", callable_mp(this, &self_type::on_body_entered));
|
||||
set_monitoring(false);
|
||||
if (!is_ready()) {
|
||||
connect("body_entered", callable_mp(this, &self_type::on_body_entered));
|
||||
connect("area_entered", callable_mp(this, &self_type::on_body_entered));
|
||||
set_monitoring(false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,9 @@ void EnemyWretched::_notification(int what) {
|
|||
default:
|
||||
return;
|
||||
case NOTIFICATION_ENTER_TREE:
|
||||
connect("child_entered_tree", callable_mp(this, &self_type::on_child_entered));
|
||||
if (!is_ready()) {
|
||||
connect("child_entered_tree", callable_mp(this, &self_type::on_child_entered));
|
||||
}
|
||||
return;
|
||||
case NOTIFICATION_READY:
|
||||
ready();
|
||||
|
|
|
|||
Loading…
Reference in a new issue