浏览代码

Merge pull request #89517 from mihe/32-max-collisions

Allow for 32 max collisions in `test_body_motion`
Rémi Verschelde 1 年之前
父节点
当前提交
84bdc8d1b0
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      servers/physics_3d/godot_space_3d.cpp

+ 1 - 1
servers/physics_3d/godot_space_3d.cpp

@@ -655,7 +655,7 @@ bool GodotSpace3D::test_body_motion(GodotBody3D *p_body, const PhysicsServer3D::
 	//this took about a week to get right..
 	//this took about a week to get right..
 	//but is it right? who knows at this point..
 	//but is it right? who knows at this point..
 
 
-	ERR_FAIL_INDEX_V(p_parameters.max_collisions, PhysicsServer3D::MotionResult::MAX_COLLISIONS, false);
+	ERR_FAIL_COND_V(p_parameters.max_collisions < 0 || p_parameters.max_collisions > PhysicsServer3D::MotionResult::MAX_COLLISIONS, false);
 
 
 	if (r_result) {
 	if (r_result) {
 		*r_result = PhysicsServer3D::MotionResult();
 		*r_result = PhysicsServer3D::MotionResult();