1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Use same boolean for objects encode and decode.

In a very unintuitive move encode needed false to encode an object,
decode needed true to decode it.
They now need the same value: `true`.
This commit is contained in:
Fabio Alessandrelli
2019-03-28 09:40:31 +01:00
parent 174b19f768
commit e61a074a8e
3 changed files with 24 additions and 25 deletions

View File

@@ -93,7 +93,7 @@ Error PacketPeer::get_var(Variant &r_variant) {
Error PacketPeer::put_var(const Variant &p_packet) {
int len;
Error err = encode_variant(p_packet, NULL, len, !allow_object_decoding); // compute len first
Error err = encode_variant(p_packet, NULL, len, allow_object_decoding); // compute len first
if (err)
return err;
@@ -102,7 +102,7 @@ Error PacketPeer::put_var(const Variant &p_packet) {
uint8_t *buf = (uint8_t *)alloca(len);
ERR_FAIL_COND_V(!buf, ERR_OUT_OF_MEMORY);
err = encode_variant(p_packet, buf, len, !allow_object_decoding);
err = encode_variant(p_packet, buf, len, allow_object_decoding);
ERR_FAIL_COND_V(err, err);
return put_packet(buf, len);