godotengine / godotengine/godot-cpp

PackedByteArray can't init and pass to const Variant **

Open
#804 2 comments 0 reactions 0 assignees View on GitHub
bug topic:gdextension
Dominant language
C++
Stars
2.7k
Forks
809
Avg merge
1d 3h
Merged PRs (30d)
8

Description

I can't pass PackedByteArray to Variant.call and get error with NIL Type

gdscript code:
```
$Example.SendRequest("connector.joingame", "aaa".to_ascii_buffer(), func(x :PackedByteArray):
if (x.size() == 0):
prints("ok")
else:
prints("nono")
)
```

c++ code:
```
....
String route = args[0]->operator String();
PackedByteArray tmpdata = args[1]->operator PackedByteArray();
Variant funcall = *args[2];

PackedByteArray tmpVar;
Variant result;
GDNativeCallError err;
std::array call_args = { &tmpVar };
funcall.call("call", (const Variant **)call_args.data(), 1, result, err);
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.