Fixes physic_fps=0 bug.

Added a condition to check if the loop exited without iteration
being run by checking the return value from idle().

Fixes: #26321
This commit is contained in:
Anish Bhobe 2019-03-09 17:06:37 +05:30
parent 9d36ce25e8
commit 3c27980a17

View file

@ -1881,7 +1881,9 @@ bool Main::iteration() {
uint64_t idle_begin = OS::get_singleton()->get_ticks_usec(); uint64_t idle_begin = OS::get_singleton()->get_ticks_usec();
OS::get_singleton()->get_main_loop()->idle(step * time_scale); if (OS::get_singleton()->get_main_loop()->idle(step * time_scale)) {
exit = true;
}
message_queue->flush(); message_queue->flush();
VisualServer::get_singleton()->sync(); //sync if still drawing from previous frames. VisualServer::get_singleton()->sync(); //sync if still drawing from previous frames.