summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2022-06-17 13:40:01 +0200
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2022-06-17 13:49:36 +0200
commit32b16c876b92c3dae35046d37740fc6e5cc65b24 (patch)
tree5157c27dd528f6f775768f70170287278b822209 /scene
parent78944fef820b7df87ca73d89169e68639ceef8e9 (diff)
[Net] Fix SceneReplicationConfig setter.
Used by resource loader, it would always add properties as both sync and spawn, disregarding the actual option value.
Diffstat (limited to 'scene')
-rw-r--r--scene/resources/scene_replication_config.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/scene/resources/scene_replication_config.cpp b/scene/resources/scene_replication_config.cpp
index 4aea04bf87..6789f9f7d5 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;
}
}