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

@@ -43,18 +43,22 @@ void RemoteTransform3D::_update_cache() {
}
void RemoteTransform3D::_update_remote() {
if (!is_inside_tree())
if (!is_inside_tree()) {
return;
}
if (cache.is_null())
if (cache.is_null()) {
return;
}
Node3D *n = Object::cast_to<Node3D>(ObjectDB::get_instance(cache));
if (!n)
if (!n) {
return;
}
if (!n->is_inside_tree())
if (!n->is_inside_tree()) {
return;
}
//todo make faster
if (use_global_coordinates) {
@@ -63,11 +67,13 @@ void RemoteTransform3D::_update_remote() {
} else {
Transform our_trans = get_global_transform();
if (update_remote_rotation)
if (update_remote_rotation) {
n->set_rotation(our_trans.basis.get_rotation());
}
if (update_remote_scale)
if (update_remote_scale) {
n->set_scale(our_trans.basis.get_scale());
}
if (update_remote_position) {
Transform n_trans = n->get_global_transform();
@@ -83,11 +89,13 @@ void RemoteTransform3D::_update_remote() {
} else {
Transform our_trans = get_transform();
if (update_remote_rotation)
if (update_remote_rotation) {
n->set_rotation(our_trans.basis.get_rotation());
}
if (update_remote_scale)
if (update_remote_scale) {
n->set_scale(our_trans.basis.get_scale());
}
if (update_remote_position) {
Transform n_trans = n->get_transform();
@@ -106,8 +114,9 @@ void RemoteTransform3D::_notification(int p_what) {
} break;
case NOTIFICATION_TRANSFORM_CHANGED: {
if (!is_inside_tree())
if (!is_inside_tree()) {
break;
}
if (cache.is_valid()) {
_update_remote();