diff options
author | Wei Guo <me@imkira.com> | 2022-10-16 19:26:13 +0800 |
---|---|---|
committer | Wei Guo <me@imkira.com> | 2022-10-16 23:02:31 +0800 |
commit | 972242d6644ccd65160c919867b58e90bac415c2 (patch) | |
tree | 7287eeb6485086649cc93b4e2f5b41ee832f5428 /modules/multiplayer | |
parent | 767f8fb483851a210f170956e238e8b0cefa3834 (diff) |
Fix MultiplayerSynchronizer peer visibility
Diffstat (limited to 'modules/multiplayer')
-rw-r--r-- | modules/multiplayer/scene_replication_interface.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/multiplayer/scene_replication_interface.cpp b/modules/multiplayer/scene_replication_interface.cpp index df9985916b..8359580805 100644 --- a/modules/multiplayer/scene_replication_interface.cpp +++ b/modules/multiplayer/scene_replication_interface.cpp @@ -261,11 +261,11 @@ Error SceneReplicationInterface::_update_sync_visibility(int p_peer, Multiplayer if (p_peer == 0) { for (KeyValue<int, PeerInfo> &E : peers_info) { // Might be visible to this specific peer. - is_visible = is_visible || p_sync->is_visible_to(E.key); - if (is_visible == E.value.sync_nodes.has(sid)) { + bool is_visible_to_peer = is_visible || p_sync->is_visible_to(E.key); + if (is_visible_to_peer == E.value.sync_nodes.has(sid)) { continue; } - if (is_visible) { + if (is_visible_to_peer) { E.value.sync_nodes.insert(sid); } else { E.value.sync_nodes.erase(sid); |