diff options
author | Juan Linietsky <reduzio@gmail.com> | 2019-02-16 16:32:30 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2019-02-16 16:32:30 -0300 |
commit | 81e15358c0027aab96f3f8e82ad8ceefcc178789 (patch) | |
tree | a6237152f6970b5a89bdd0d5141c20780c9e88bb /servers | |
parent | 6d4eaebe1ed4c900dee24fb755dd57514372529b (diff) |
Skip disabled shape when getting rest info. Fixes #25941
Diffstat (limited to 'servers')
-rw-r--r-- | servers/physics_2d/space_2d_sw.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp index c9a670afaf..2e338b03cc 100644 --- a/servers/physics_2d/space_2d_sw.cpp +++ b/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); |