Browse Source

Move the shape test to a little sooner

George Marques 10 năm trước cách đây
mục cha
commit
5ff0b69dae
1 tập tin đã thay đổi với 4 bổ sung3 xóa
  1. 4 3
      scene/2d/collision_shape_2d.cpp

+ 4 - 3
scene/2d/collision_shape_2d.cpp

@@ -113,13 +113,14 @@ void CollisionShape2D::_notification(int p_what) {
 				break;
 			}
 
+			if (!shape.is_valid()) {
+				break;
+			}
+
 			rect=Rect2();
 
 
 			Color draw_col=get_tree()->get_debug_collisions_color();
-            if(!shape.is_valid()) {
-                break;
-            }
 			shape->draw(get_canvas_item(),draw_col);