summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaracenOne <SaracenOne@gmail.com>2021-09-02 21:32:03 +0100
committerSaracenOne <SaracenOne@gmail.com>2021-09-02 21:36:54 +0100
commitf09f12ce5591ffb0fd639db78cf3027002ef63d8 (patch)
treeda19f2b5de9efa891bef88b97cb11793e97d5887
parent29a3300c6aaa2c7915c39ad633dc3b0ce0a8505b (diff)
Fix _send_default_spawn_default function sending zero length
PackedByteArray when deriving from a single PackedByteArray state 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);