summaryrefslogtreecommitdiff
path: root/servers
diff options
context:
space:
mode:
authorPedro J. Estébanez <pedrojrulez@gmail.com>2017-07-25 03:56:15 +0200
committerPedro J. Estébanez <pedrojrulez@gmail.com>2017-07-25 03:57:11 +0200
commitb4129df96c455b0657712b8f6a772265a22e2265 (patch)
tree37a22b8c0a3a9e665acd6de2725545fc1aa2079f /servers
parent91bb4952e4f01d8a8fa729c2db2fb6beb5bce0ec (diff)
Fix crash in Space2DSW::test_body_motion()
Fixes #9692.
Diffstat (limited to 'servers')
-rw-r--r--servers/physics_2d/space_2d_sw.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp
index c407a17bc6..a17d1f6a12 100644
--- a/servers/physics_2d/space_2d_sw.cpp
+++ b/servers/physics_2d/space_2d_sw.cpp
@@ -553,7 +553,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co
const CollisionObject2DSW *col_obj = intersection_query_results[i];
int shape_idx = intersection_query_subindex_results[i];
- if (col_obj->is_shape_set_as_one_way_collision(j)) {
+ if (col_obj->is_shape_set_as_one_way_collision(shape_idx)) {
cbk.valid_dir = body_shape_xform.get_axis(1).normalized();
cbk.valid_depth = p_margin; //only valid depth is the collision margin