Merge pull request #83003 from AThousandShips/null_check_extra

Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicable
This commit is contained in:
Rémi Verschelde
2023-10-09 15:37:14 +02:00
45 changed files with 85 additions and 85 deletions

View File

@@ -211,7 +211,7 @@ Variant GodotArea3D::get_param(PhysicsServer3D::AreaParameter p_param) const {
}
void GodotArea3D::_queue_monitor_update() {
ERR_FAIL_COND(!get_space());
ERR_FAIL_NULL(get_space());
if (!monitor_query_list.in_list()) {
get_space()->area_add_to_monitor_query_list(&monitor_query_list);

View File

@@ -477,7 +477,7 @@ void GodotBody3D::integrate_forces(real_t p_step) {
return;
}
ERR_FAIL_COND(!get_space());
ERR_FAIL_NULL(get_space());
int ac = areas.size();

View File

@@ -912,7 +912,7 @@ void GodotPhysicsServer3D::body_set_ray_pickable(RID p_body, bool p_enable) {
bool GodotPhysicsServer3D::body_test_motion(RID p_body, const MotionParameters &p_parameters, MotionResult *r_result) {
GodotBody3D *body = body_owner.get_or_null(p_body);
ERR_FAIL_NULL_V(body, false);
ERR_FAIL_COND_V(!body->get_space(), false);
ERR_FAIL_NULL_V(body->get_space(), false);
ERR_FAIL_COND_V(body->get_space()->is_locked(), false);
_update_shapes();
@@ -1225,7 +1225,7 @@ void GodotPhysicsServer3D::joint_make_pin(RID p_joint, RID p_body_A, const Vecto
ERR_FAIL_NULL(body_A);
if (!p_body_B.is_valid()) {
ERR_FAIL_COND(!body_A->get_space());
ERR_FAIL_NULL(body_A->get_space());
p_body_B = body_A->get_space()->get_static_global_body();
}
@@ -1297,7 +1297,7 @@ void GodotPhysicsServer3D::joint_make_hinge(RID p_joint, RID p_body_A, const Tra
ERR_FAIL_NULL(body_A);
if (!p_body_B.is_valid()) {
ERR_FAIL_COND(!body_A->get_space());
ERR_FAIL_NULL(body_A->get_space());
p_body_B = body_A->get_space()->get_static_global_body();
}
@@ -1321,7 +1321,7 @@ void GodotPhysicsServer3D::joint_make_hinge_simple(RID p_joint, RID p_body_A, co
ERR_FAIL_NULL(body_A);
if (!p_body_B.is_valid()) {
ERR_FAIL_COND(!body_A->get_space());
ERR_FAIL_NULL(body_A->get_space());
p_body_B = body_A->get_space()->get_static_global_body();
}
@@ -1422,7 +1422,7 @@ void GodotPhysicsServer3D::joint_make_slider(RID p_joint, RID p_body_A, const Tr
ERR_FAIL_NULL(body_A);
if (!p_body_B.is_valid()) {
ERR_FAIL_COND(!body_A->get_space());
ERR_FAIL_NULL(body_A->get_space());
p_body_B = body_A->get_space()->get_static_global_body();
}
@@ -1462,7 +1462,7 @@ void GodotPhysicsServer3D::joint_make_cone_twist(RID p_joint, RID p_body_A, cons
ERR_FAIL_NULL(body_A);
if (!p_body_B.is_valid()) {
ERR_FAIL_COND(!body_A->get_space());
ERR_FAIL_NULL(body_A->get_space());
p_body_B = body_A->get_space()->get_static_global_body();
}
@@ -1502,7 +1502,7 @@ void GodotPhysicsServer3D::joint_make_generic_6dof(RID p_joint, RID p_body_A, co
ERR_FAIL_NULL(body_A);
if (!p_body_B.is_valid()) {
ERR_FAIL_COND(!body_A->get_space());
ERR_FAIL_NULL(body_A->get_space());
p_body_B = body_A->get_space()->get_static_global_body();
}

View File

@@ -967,7 +967,7 @@ Vector3 GodotSoftBody3D::_compute_area_windforce(const GodotArea3D *p_area, cons
void GodotSoftBody3D::predict_motion(real_t p_delta) {
const real_t inv_delta = 1.0 / p_delta;
ERR_FAIL_COND(!get_space());
ERR_FAIL_NULL(get_space());
bool gravity_done = false;
Vector3 gravity;