Explorar o código

Remove the "is able to sleep" condition for adding visibility notifier nodes, fixes #19659
I think the previous behavior was more useful, but I understand it's not obvious or discoverable.

Juan Linietsky %!s(int64=6) %!d(string=hai) anos
pai
achega
c500581d32
Modificáronse 2 ficheiros con 2 adicións e 2 borrados
  1. 1 1
      scene/2d/visibility_notifier_2d.cpp
  2. 1 1
      scene/3d/visibility_notifier.cpp

+ 1 - 1
scene/2d/visibility_notifier_2d.cpp

@@ -190,7 +190,7 @@ void VisibilityEnabler2D::_find_nodes(Node *p_node) {
 	if (enabler[ENABLER_FREEZE_BODIES]) {
 
 		RigidBody2D *rb2d = Object::cast_to<RigidBody2D>(p_node);
-		if (rb2d && ((rb2d->get_mode() == RigidBody2D::MODE_CHARACTER || (rb2d->get_mode() == RigidBody2D::MODE_RIGID && !rb2d->is_able_to_sleep())))) {
+		if (rb2d && ((rb2d->get_mode() == RigidBody2D::MODE_CHARACTER || rb2d->get_mode() == RigidBody2D::MODE_RIGID))) {
 
 			add = true;
 			meta = rb2d->get_mode();

+ 1 - 1
scene/3d/visibility_notifier.cpp

@@ -153,7 +153,7 @@ void VisibilityEnabler::_find_nodes(Node *p_node) {
 	if (enabler[ENABLER_FREEZE_BODIES]) {
 
 		RigidBody *rb = Object::cast_to<RigidBody>(p_node);
-		if (rb && ((rb->get_mode() == RigidBody::MODE_CHARACTER || (rb->get_mode() == RigidBody::MODE_RIGID && !rb->is_able_to_sleep())))) {
+		if (rb && ((rb->get_mode() == RigidBody::MODE_CHARACTER || rb->get_mode() == RigidBody::MODE_RIGID))) {
 
 			add = true;
 			meta = rb->get_mode();