summaryrefslogtreecommitdiff
path: root/modules/multiplayer
diff options
context:
space:
mode:
authorWei Guo <me@imkira.com>2022-10-16 19:26:13 +0800
committerWei Guo <me@imkira.com>2022-10-16 23:02:31 +0800
commit972242d6644ccd65160c919867b58e90bac415c2 (patch)
tree7287eeb6485086649cc93b4e2f5b41ee832f5428 /modules/multiplayer
parent767f8fb483851a210f170956e238e8b0cefa3834 (diff)
Fix MultiplayerSynchronizer peer visibility
Diffstat (limited to 'modules/multiplayer')
-rw-r--r--modules/multiplayer/scene_replication_interface.cpp6
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);