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:
|
default:
|
||||||
return;
|
return;
|
||||||
case NOTIFICATION_ENTER_TREE:
|
case NOTIFICATION_ENTER_TREE:
|
||||||
connect("body_entered", callable_mp(this, &self_type::on_body_entered));
|
if (!is_ready()) {
|
||||||
connect("area_entered", callable_mp(this, &self_type::on_body_entered));
|
connect("body_entered", callable_mp(this, &self_type::on_body_entered));
|
||||||
set_monitoring(false);
|
connect("area_entered", callable_mp(this, &self_type::on_body_entered));
|
||||||
|
set_monitoring(false);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,9 @@ void EnemyWretched::_notification(int what) {
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
case NOTIFICATION_ENTER_TREE:
|
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;
|
return;
|
||||||
case NOTIFICATION_READY:
|
case NOTIFICATION_READY:
|
||||||
ready();
|
ready();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue