1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Merge pull request #110964 from mihe/jolt/invalid-test-motion

Fix crash when calling `move_and_collide` with a null `jolt_body`
This commit is contained in:
Thaddeus Crews
2025-09-30 20:10:49 -05:00

View File

@@ -861,6 +861,10 @@ Vector3 JoltPhysicsDirectSpaceState3D::get_closest_point_to_object_volume(RID p_
bool JoltPhysicsDirectSpaceState3D::body_test_motion(const JoltBody3D &p_body, const PhysicsServer3D::MotionParameters &p_parameters, PhysicsServer3D::MotionResult *r_result) const {
ERR_FAIL_COND_V_MSG(space->is_stepping(), false, "body_test_motion (maybe from move_and_slide?) must not be called while the physics space is being stepped.");
if (!p_body.in_space()) {
return false;
}
space->flush_pending_objects();
const float margin = MAX((float)p_parameters.margin, 0.0001f);