-
-
Notifications
You must be signed in to change notification settings - Fork 20.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Writing bool values to PoolByteArray works in debug but not release exports #48999
Comments
In Godot 3.x, Pool*Arrays are passed by value instead of reference. Maybe that explains it? Either way, the behavior should not differ between debug and release. In Godot 4.0, Packed*Arrays are passed by reference until they're passed to a low-level server, in which case they are passed by value. |
More context than in the snippet above: extends Node
var byte_data := PoolByteArray([false, false, false, false, false])
func _ready():
print("======= BOOL =======")
print("Start:\t\t", pba_str(byte_data))
byte_data[2] = true
print("Expected:\t00100\nGot:\t\t", pba_str(byte_data))
I access the Vector by value there. |
That's a weird bug, but it seems to be related to your use of boolean values. It works fine with ints: var byte_data := PoolByteArray([0, 1, 2, 3, 4])
func _ready():
print("before")
for b in byte_data: print(b)
byte_data[2] = 6
print("after")
for b in byte_data: print(b)
It works fine if you cast the bool to int explicitly ( |
Okay. Good to know. That seems to be an GDScript bug? |
Yeah, looks like GDScript issue to me, there were many debug vs. release differences in GDScript implementation in the past. |
Fixed by #57851. |
Godot version:
3.3.1
OS/device including version:
Windows 10, 19042.928
Issue description:
You can't write to PoolVectorArrays in release exports.
Debug (Editor/Export):
Release Export:
with code:
Steps to reproduce:
Minimal reproduction project:
PoolVector.zip
The project includes test for all PoolVector types.
The text was updated successfully, but these errors were encountered: