From 32b16c876b92c3dae35046d37740fc6e5cc65b24 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Fri, 17 Jun 2022 13:40:01 +0200 Subject: [PATCH] [Net] Fix SceneReplicationConfig setter. Used by resource loader, it would always add properties as both sync and spawn, disregarding the actual option value. --- scene/resources/scene_replication_config.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scene/resources/scene_replication_config.cpp b/scene/resources/scene_replication_config.cpp index 4aea04bf8767..6789f9f7d51a 100644 --- a/scene/resources/scene_replication_config.cpp +++ b/scene/resources/scene_replication_config.cpp @@ -52,11 +52,19 @@ bool SceneReplicationConfig::_set(const StringName &p_name, const Variant &p_val ReplicationProperty &prop = properties[idx]; if (what == "sync") { prop.sync = p_value; - sync_props.push_back(prop.name); + if (prop.sync) { + sync_props.push_back(prop.name); + } else { + sync_props.erase(prop.name); + } return true; } else if (what == "spawn") { prop.spawn = p_value; - spawn_props.push_back(prop.name); + if (prop.spawn) { + spawn_props.push_back(prop.name); + } else { + spawn_props.erase(prop.name); + } return true; } }