mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +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:
parent
07bc4e2f96
commit
0ee0fa42e6
683 changed files with 22803 additions and 12225 deletions
|
|
@ -37,38 +37,43 @@ void Timer::_notification(int p_what) {
|
|||
case NOTIFICATION_READY: {
|
||||
if (autostart) {
|
||||
#ifdef TOOLS_ENABLED
|
||||
if (Engine::get_singleton()->is_editor_hint() && get_tree()->get_edited_scene_root() && (get_tree()->get_edited_scene_root() == this || get_tree()->get_edited_scene_root()->is_a_parent_of(this)))
|
||||
if (Engine::get_singleton()->is_editor_hint() && get_tree()->get_edited_scene_root() && (get_tree()->get_edited_scene_root() == this || get_tree()->get_edited_scene_root()->is_a_parent_of(this))) {
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
start();
|
||||
autostart = false;
|
||||
}
|
||||
} break;
|
||||
case NOTIFICATION_INTERNAL_PROCESS: {
|
||||
if (timer_process_mode == TIMER_PROCESS_PHYSICS || !is_processing_internal())
|
||||
if (timer_process_mode == TIMER_PROCESS_PHYSICS || !is_processing_internal()) {
|
||||
return;
|
||||
}
|
||||
time_left -= get_process_delta_time();
|
||||
|
||||
if (time_left < 0) {
|
||||
if (!one_shot)
|
||||
if (!one_shot) {
|
||||
time_left += wait_time;
|
||||
else
|
||||
} else {
|
||||
stop();
|
||||
}
|
||||
|
||||
emit_signal("timeout");
|
||||
}
|
||||
|
||||
} break;
|
||||
case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: {
|
||||
if (timer_process_mode == TIMER_PROCESS_IDLE || !is_physics_processing_internal())
|
||||
if (timer_process_mode == TIMER_PROCESS_IDLE || !is_physics_processing_internal()) {
|
||||
return;
|
||||
}
|
||||
time_left -= get_physics_process_delta_time();
|
||||
|
||||
if (time_left < 0) {
|
||||
if (!one_shot)
|
||||
if (!one_shot) {
|
||||
time_left += wait_time;
|
||||
else
|
||||
} else {
|
||||
stop();
|
||||
}
|
||||
emit_signal("timeout");
|
||||
}
|
||||
|
||||
|
|
@ -118,8 +123,9 @@ void Timer::stop() {
|
|||
}
|
||||
|
||||
void Timer::set_paused(bool p_paused) {
|
||||
if (paused == p_paused)
|
||||
if (paused == p_paused) {
|
||||
return;
|
||||
}
|
||||
|
||||
paused = p_paused;
|
||||
_set_process(processing);
|
||||
|
|
@ -138,8 +144,9 @@ float Timer::get_time_left() const {
|
|||
}
|
||||
|
||||
void Timer::set_timer_process_mode(TimerProcessMode p_mode) {
|
||||
if (timer_process_mode == p_mode)
|
||||
if (timer_process_mode == p_mode) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (timer_process_mode) {
|
||||
case TIMER_PROCESS_PHYSICS:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue