summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-10-17 17:31:20 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-10-17 17:31:20 +0200
commitc43ce5e341cc9c84b3e4d3f4f25d6ce989afc5c2 (patch)
tree9de56994e09146a7d9ea43db62f2080e6b8056b3 /modules
parent36d5f0d1cced1b548707b1081093dda46b92676e (diff)
parent972242d6644ccd65160c919867b58e90bac415c2 (diff)
Merge pull request #67485 from kdada/kdada/master
Fix peer visiblity in SceneReplicationInterface._update_sync_visibility
Diffstat (limited to 'modules')
-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);