1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-10 13:00:37 +00:00

Style: Enforce braces around if blocks and loops

Using clang-tidy's `readability-braces-around-statements`.
https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
This commit is contained in:
Rémi Verschelde
2020-05-14 16:41:43 +02:00
parent 07bc4e2f96
commit 0ee0fa42e6
683 changed files with 22803 additions and 12225 deletions

View File

@@ -326,8 +326,9 @@ void BulletPhysicsServer3D::area_clear_shapes(RID p_area) {
AreaBullet *area = area_owner.getornull(p_area);
ERR_FAIL_COND(!area);
for (int i = area->get_shape_count(); 0 < i; --i)
for (int i = area->get_shape_count(); 0 < i; --i) {
area->remove_shape_full(0);
}
}
void BulletPhysicsServer3D::area_set_shape_disabled(RID p_area, int p_shape_idx, bool p_disabled) {
@@ -443,8 +444,9 @@ RID BulletPhysicsServer3D::body_create(BodyMode p_mode, bool p_init_sleeping) {
body->set_mode(p_mode);
body->set_collision_layer(1);
body->set_collision_mask(1);
if (p_init_sleeping)
if (p_init_sleeping) {
body->set_state(BODY_STATE_SLEEPING, p_init_sleeping);
}
CreateThenReturnRID(rigid_body_owner, body);
}
@@ -458,8 +460,9 @@ void BulletPhysicsServer3D::body_set_space(RID p_body, RID p_space) {
ERR_FAIL_COND(!space);
}
if (body->get_space() == space)
if (body->get_space() == space) {
return; //pointles
}
body->set_space(space);
}
@@ -469,8 +472,9 @@ RID BulletPhysicsServer3D::body_get_space(RID p_body) const {
ERR_FAIL_COND_V(!body, RID());
SpaceBullet *space = body->get_space();
if (!space)
if (!space) {
return RID();
}
return space->get_self();
}
@@ -870,8 +874,9 @@ RID BulletPhysicsServer3D::soft_body_create(bool p_init_sleeping) {
SoftBodyBullet *body = bulletnew(SoftBodyBullet);
body->set_collision_layer(1);
body->set_collision_mask(1);
if (p_init_sleeping)
if (p_init_sleeping) {
body->set_activation_state(false);
}
CreateThenReturnRID(soft_body_owner, body);
}
@@ -892,8 +897,9 @@ void BulletPhysicsServer3D::soft_body_set_space(RID p_body, RID p_space) {
ERR_FAIL_COND(!space);
}
if (body->get_space() == space)
if (body->get_space() == space) {
return; //pointles
}
body->set_space(space);
}
@@ -903,8 +909,9 @@ RID BulletPhysicsServer3D::soft_body_get_space(RID p_body) const {
ERR_FAIL_COND_V(!body, RID());
SpaceBullet *space = body->get_space();
if (!space)
if (!space) {
return RID();
}
return space->get_self();
}
@@ -1535,8 +1542,9 @@ void BulletPhysicsServer3D::init() {
}
void BulletPhysicsServer3D::step(float p_deltaTime) {
if (!active)
if (!active) {
return;
}
BulletPhysicsDirectBodyState3D::singleton_setDeltaTime(p_deltaTime);