Merge pull request #52354 from V-Sekai/single_packed_array_spawn_fix

Fix sending zero-length spawn variant
This commit is contained in:
Fabio Alessandrelli 2021-09-03 02:55:34 +02:00 committed by GitHub
commit c39d31899a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -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);