mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03: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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user