From 73c95baa5266edf7bf83804756bb740a28243dfe Mon Sep 17 00:00:00 2001 From: Sander Vanhove Date: Fri, 22 Aug 2025 17:08:16 +0200 Subject: [PATCH] Fix peers stopping replication on deleting node they spawned When multiple peers had multiplayer authority over a MultiplayerSpawner and spawned nodes that used a MultiplayerSynchronizer that were later deleted, these peers would stop syncing random nodes from other peers because the net_id of said spawned nodes was not unique over all peers. The net_id was the only criteria that was looked at to stop syncing the node. This commit fixes this by also looking at the peer the node came from. --- modules/multiplayer/scene_replication_interface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/multiplayer/scene_replication_interface.cpp b/modules/multiplayer/scene_replication_interface.cpp index edc66c876c..091482852c 100644 --- a/modules/multiplayer/scene_replication_interface.cpp +++ b/modules/multiplayer/scene_replication_interface.cpp @@ -283,7 +283,7 @@ Error SceneReplicationInterface::on_replication_stop(Object *p_obj, Variant p_co for (KeyValue &E : peers_info) { E.value.sync_nodes.erase(sid); E.value.last_watch_usecs.erase(sid); - if (sync->get_net_id()) { + if (sync->get_net_id() && uint32_t(E.key) == tobj.remote_peer) { E.value.recv_sync_ids.erase(sync->get_net_id()); } }