1
0
mirror of https://github.com/godotengine/godot.git synced 2026-01-06 19:41:11 +00:00

Respect returned bool from virtual process methods in SceneTree

SceneTree overrides the virtual `process` and `physics_process` methods
that it inherits from MainLoop. These methods return a boolean that
determines if the main loop should end.
The SceneTree was ignoring the returned boolean, so scripts inheriting
from SceneTree that override these methods and return true didn't exit
the main loop. Now the boolean is checked.
This commit is contained in:
Raul Santos
2023-06-18 20:44:22 +02:00
parent 4a0bb80b18
commit 5373b67e2a

View File

@@ -456,7 +456,9 @@ bool SceneTree::physics_process(double p_time) {
flush_transform_notifications();
MainLoop::physics_process(p_time);
if (MainLoop::physics_process(p_time)) {
_quit = true;
}
physics_process_time = p_time;
emit_signal(SNAME("physics_frame"));
@@ -484,7 +486,9 @@ bool SceneTree::physics_process(double p_time) {
bool SceneTree::process(double p_time) {
root_lock++;
MainLoop::process(p_time);
if (MainLoop::process(p_time)) {
_quit = true;
}
process_time = p_time;