diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2022-06-17 18:10:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-17 18:10:23 +0200 |
commit | 7320871ffa8885ddd7ebedd08ae1fc85b87f5dc3 (patch) | |
tree | 5f833b5e6827a7789749d769f907f801350bef79 /scene/resources | |
parent | 4463dd9d897db222679d3bfe9bdc8f7f7adce214 (diff) | |
parent | 32b16c876b92c3dae35046d37740fc6e5cc65b24 (diff) |
Merge pull request #62144 from Faless/mp/4.x_replication_config_setter
[Net] Fix SceneReplicationConfig setter.
Diffstat (limited to 'scene/resources')
-rw-r--r-- | scene/resources/scene_replication_config.cpp | 12 |
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; } } |