mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Ensure process notification is received only if really enabled, fixes #7894
(cherry picked from commit 15db793ef2)
This commit is contained in:
committed by
Rémi Verschelde
parent
a93e28291f
commit
8ff42771a4
@@ -238,7 +238,7 @@ void Node::_propagate_enter_tree() {
|
||||
|
||||
void Node::_propagate_exit_tree() {
|
||||
|
||||
//block while removing children
|
||||
//block while removing children
|
||||
|
||||
#ifdef DEBUG_ENABLED
|
||||
|
||||
@@ -990,6 +990,17 @@ bool Node::can_call_rset(const StringName &p_property, int p_from) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Node::can_process_notification(int p_what) const {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_PHYSICS_PROCESS: return data.physics_process;
|
||||
case NOTIFICATION_PROCESS: return data.idle_process;
|
||||
case NOTIFICATION_INTERNAL_PROCESS: return data.idle_process_internal;
|
||||
case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: return data.physics_process_internal;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Node::can_process() const {
|
||||
|
||||
ERR_FAIL_COND_V(!is_inside_tree(), false);
|
||||
|
||||
Reference in New Issue
Block a user