summaryrefslogtreecommitdiff
path: root/servers
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2015-12-08 17:09:47 -0300
committerJuan Linietsky <reduzio@gmail.com>2015-12-08 17:09:47 -0300
commitff936c6b2e79ffe9c93b855f417803c157fa4922 (patch)
tree763f908a85271ec856c81c2828d0e9d2f7a58344 /servers
parentc26f66abde5d2493be09ba7eeb9fcfae646b9fb7 (diff)
parent9457211f8fd673eb5ef7d32c7ddb0157d2735753 (diff)
Merge pull request #2868 from akien-mga/pr-fix-can-move-to
Fix can_move_to and rename it for more clarity
Diffstat (limited to 'servers')
-rw-r--r--servers/physics/space_sw.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/servers/physics/space_sw.cpp b/servers/physics/space_sw.cpp
index ba1c737530..778d20d3f1 100644
--- a/servers/physics/space_sw.cpp
+++ b/servers/physics/space_sw.cpp
@@ -175,13 +175,15 @@ int PhysicsDirectSpaceStateSW::intersect_shape(const RID& p_shape, const Transfo
if (!CollisionSolverSW::solve_static(shape,p_xform,col_obj->get_shape(shape_idx),col_obj->get_transform() * col_obj->get_shape_transform(shape_idx), NULL,NULL,NULL,p_margin,0))
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);
- else
- r_results[cc].collider=NULL;
- r_results[cc].rid=col_obj->get_self();
- r_results[cc].shape=shape_idx;
+ if (r_results) {
+ 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);
+ else
+ r_results[cc].collider=NULL;
+ r_results[cc].rid=col_obj->get_self();
+ r_results[cc].shape=shape_idx;
+ }
cc++;