diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2016-10-09 14:04:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-09 14:04:22 +0200 |
commit | 74917d7037e27c81dc5817b2c47820a2256b69e5 (patch) | |
tree | 86c29a1afe6db26fb02cbae3bb04d5e6586d1286 /servers | |
parent | ddf2acad4efe661a38bc9ee7a451e41e159e7b79 (diff) | |
parent | e5edd50d6231dfc63b5309cbad56cdba05256a89 (diff) |
Merge pull request #6627 from seijihariki/fix_crash_collider_overlap
Fix for crash when finding intersection on colliders that overlap
Diffstat (limited to 'servers')
-rw-r--r-- | servers/physics_2d/space_2d_sw.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp index d0dcee7763..3d702ebb93 100644 --- a/servers/physics_2d/space_2d_sw.cpp +++ b/servers/physics_2d/space_2d_sw.cpp @@ -81,6 +81,9 @@ int Physics2DDirectSpaceStateSW::intersect_point(const Vector2& p_point,ShapeRes if (!shape->contains_point(local_point)) continue; + if (cc>=p_result_max) + continue; + r_results[cc].collider_id=col_obj->get_instance_id(); if (r_results[cc].collider_id!=0) r_results[cc].collider=ObjectDB::get_instance(r_results[cc].collider_id); |