summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2021-09-03 02:55:34 +0200
committerGitHub <noreply@github.com>2021-09-03 02:55:34 +0200
commitc39d31899a9e35fb1166834c68b566978ef5066d (patch)
tree013d4c70041c8d70b59a5612096f556376cdc35a
parentb73e7623c82f27f6327922217ad72198223a7109 (diff)
parentf09f12ce5591ffb0fd639db78cf3027002ef63d8 (diff)
Merge pull request #52354 from V-Sekai/single_packed_array_spawn_fix
Fix sending zero-length spawn variant
-rw-r--r--core/io/multiplayer_replicator.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/io/multiplayer_replicator.cpp b/core/io/multiplayer_replicator.cpp
index 1642aab136..b9d0675af1 100644
--- a/core/io/multiplayer_replicator.cpp
+++ b/core/io/multiplayer_replicator.cpp
@@ -189,6 +189,8 @@ Error MultiplayerReplicator::_send_default_spawn_despawn(int p_peer_id, const Re
bool is_raw = false;
if (state_variants.size() == 1 && state_variants[0].get_type() == Variant::PACKED_BYTE_ARRAY) {
is_raw = true;
+ const PackedByteArray pba = state_variants[0];
+ state_len = pba.size();
} else if (state_variants.size()) {
err = _encode_state(state_variants, nullptr, state_len);
ERR_FAIL_COND_V(err, err);