summaryrefslogtreecommitdiff
path: root/scene/resources/scene_replication_config.cpp
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2022-06-17 18:10:23 +0200
committerGitHub <noreply@github.com>2022-06-17 18:10:23 +0200
commit7320871ffa8885ddd7ebedd08ae1fc85b87f5dc3 (patch)
tree5f833b5e6827a7789749d769f907f801350bef79 /scene/resources/scene_replication_config.cpp
parent4463dd9d897db222679d3bfe9bdc8f7f7adce214 (diff)
parent32b16c876b92c3dae35046d37740fc6e5cc65b24 (diff)
Merge pull request #62144 from Faless/mp/4.x_replication_config_setter
[Net] Fix SceneReplicationConfig setter.
Diffstat (limited to 'scene/resources/scene_replication_config.cpp')
-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;
}
}