Browse Source

Skip disabled shape when getting rest info. Fixes #25941

Juan Linietsky 6 years ago
parent
commit
81e15358c0
1 changed files with 4 additions and 0 deletions
  1. 4 0
      servers/physics_2d/space_2d_sw.cpp

+ 4 - 0
servers/physics_2d/space_2d_sw.cpp

@@ -1024,6 +1024,10 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co
 		int to_shape = best_shape != -1 ? best_shape + 1 : p_body->get_shape_count();
 
 		for (int j = from_shape; j < to_shape; j++) {
+
+			if (p_body->is_shape_set_as_disabled(j))
+				continue;
+
 			Transform2D body_shape_xform = ugt * p_body->get_shape_transform(j);
 			Shape2DSW *body_shape = p_body->get_shape(j);