Ensure process notification is received only if really enabled, fixes #7894
This commit is contained in:
parent
e896261b87
commit
15db793ef2
|
@ -725,6 +725,17 @@ const Map<StringName, MultiplayerAPI::RPCMode>::Element *Node::get_node_rset_mod
|
||||||
return data.rpc_properties.find(p_property);
|
return data.rpc_properties.find(p_property);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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 {
|
bool Node::can_process() const {
|
||||||
|
|
||||||
ERR_FAIL_COND_V(!is_inside_tree(), false);
|
ERR_FAIL_COND_V(!is_inside_tree(), false);
|
||||||
|
|
|
@ -364,6 +364,7 @@ public:
|
||||||
void set_pause_mode(PauseMode p_mode);
|
void set_pause_mode(PauseMode p_mode);
|
||||||
PauseMode get_pause_mode() const;
|
PauseMode get_pause_mode() const;
|
||||||
bool can_process() const;
|
bool can_process() const;
|
||||||
|
bool can_process_notification(int p_what) const;
|
||||||
|
|
||||||
void request_ready();
|
void request_ready();
|
||||||
|
|
||||||
|
|
|
@ -951,6 +951,8 @@ void SceneTree::_notify_group_pause(const StringName &p_group, int p_notificatio
|
||||||
|
|
||||||
if (!n->can_process())
|
if (!n->can_process())
|
||||||
continue;
|
continue;
|
||||||
|
if (!n->can_process_notification(p_notification))
|
||||||
|
continue;
|
||||||
|
|
||||||
n->notification(p_notification);
|
n->notification(p_notification);
|
||||||
//ERR_FAIL_COND(node_count != g.nodes.size());
|
//ERR_FAIL_COND(node_count != g.nodes.size());
|
||||||
|
|
Loading…
Reference in New Issue