summaryrefslogtreecommitdiffstats
path: root/include/godot_cpp
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2021-09-08 15:07:23 -0300
committerBastiaan Olij <mux213@gmail.com>2021-09-27 23:08:10 +1000
commitf5858ef6c69259c6f0d078e7ee45c0c6283572b0 (patch)
tree86645064a22e980c398d2cf68c893fd53f93e9e9 /include/godot_cpp
parent46c63af715cf42a6e27feb48a3e7ed6d6dd9458c (diff)
downloadredot-cpp-f5858ef6c69259c6f0d078e7ee45c0c6283572b0.tar.gz
Fix calling of native functions that return object types
Diffstat (limited to 'include/godot_cpp')
-rw-r--r--include/godot_cpp/core/engine_ptrcall.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/godot_cpp/core/engine_ptrcall.hpp b/include/godot_cpp/core/engine_ptrcall.hpp
index 636a0c2..3cb9ae0 100644
--- a/include/godot_cpp/core/engine_ptrcall.hpp
+++ b/include/godot_cpp/core/engine_ptrcall.hpp
@@ -44,11 +44,11 @@ namespace godot {
namespace internal {
template <class O, class... Args>
-Object *_call_native_mb_ret_obj(const GDNativeMethodBindPtr mb, void *instance, const Args &...args) {
+O *_call_native_mb_ret_obj(const GDNativeMethodBindPtr mb, void *instance, const Args &...args) {
GodotObject *ret = nullptr;
std::array<const GDNativeTypePtr, sizeof...(Args)> mb_args = { { (const GDNativeTypePtr)args... } };
internal::interface->object_method_bind_ptrcall(mb, instance, mb_args.data(), &ret);
- return (Object *)internal::interface->object_get_instance_binding(ret, internal::token, &O::___binding_callbacks);
+ return reinterpret_cast<O *>(internal::interface->object_get_instance_binding(ret, internal::token, &O::___binding_callbacks));
}
template <class R, class... Args>