diff options
Diffstat (limited to 'scene')
-rw-r--r-- | scene/main/node.cpp | 7 | ||||
-rw-r--r-- | scene/main/node.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/scene/main/node.cpp b/scene/main/node.cpp index f1e5574351..14cd76ab7d 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -116,6 +116,9 @@ void Node::_notification(int p_notification) { memdelete(data.path_cache); data.path_cache = nullptr; } + if (data.filename.length()) { + get_multiplayer()->scene_enter_exit_notify(data.filename, this, false); + } } break; case NOTIFICATION_PATH_CHANGED: { if (data.path_cache) { @@ -147,6 +150,10 @@ void Node::_notification(int p_notification) { get_script_instance()->call(SceneStringNames::get_singleton()->_ready); } + if (data.filename.length()) { + ERR_FAIL_COND(!is_inside_tree()); + get_multiplayer()->scene_enter_exit_notify(data.filename, this, true); + } } break; case NOTIFICATION_POSTINITIALIZE: { diff --git a/scene/main/node.h b/scene/main/node.h index 0a88553ea1..7175d4c740 100644 --- a/scene/main/node.h +++ b/scene/main/node.h @@ -202,6 +202,7 @@ protected: static String _get_name_num_separator(); friend class SceneState; + friend class MultiplayerAPI; void _add_child_nocheck(Node *p_child, const StringName &p_name); void _set_owner_nocheck(Node *p_owner); |