summaryrefslogtreecommitdiffstats
path: root/include/godot_cpp
diff options
context:
space:
mode:
authorEmmanuel Leblond <emmanuel.leblond@gmail.com>2022-10-23 14:45:57 +0200
committerEmmanuel Leblond <emmanuel.leblond@gmail.com>2022-11-08 21:44:32 +0100
commit3b82d5937bd1b4d44cc38cbdbc59ee37a89f07fd (patch)
treebb9dc8068a47762a8df97bada864511f6ce44bcd /include/godot_cpp
parentd1963dc133d3fdc8f6ab90d47a87158dac7ebd2a (diff)
downloadredot-cpp-3b82d5937bd1b4d44cc38cbdbc59ee37a89f07fd.tar.gz
Correct GDNativeExtensionScriptInstanceToString
Diffstat (limited to 'include/godot_cpp')
-rw-r--r--include/godot_cpp/classes/wrapped.hpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/godot_cpp/classes/wrapped.hpp b/include/godot_cpp/classes/wrapped.hpp
index 58da771..5208e4e 100644
--- a/include/godot_cpp/classes/wrapped.hpp
+++ b/include/godot_cpp/classes/wrapped.hpp
@@ -67,7 +67,7 @@ protected:
static void free_property_list_bind(GDExtensionClassInstancePtr p_instance, const GDNativePropertyInfo *p_list) {}
static GDNativeBool property_can_revert_bind(GDExtensionClassInstancePtr p_instance, const GDNativeStringNamePtr p_name) { return false; }
static GDNativeBool property_get_revert_bind(GDExtensionClassInstancePtr p_instance, const GDNativeStringNamePtr p_name, GDNativeVariantPtr r_ret) { return false; }
- static void to_string_bind(GDExtensionClassInstancePtr p_instance, GDNativeStringPtr r_out) {}
+ static void to_string_bind(GDExtensionClassInstancePtr p_instance, GDNativeBool *r_is_valid, GDNativeStringPtr r_out) {}
GDNativePropertyInfo *plist = nullptr;
uint32_t plist_size = 0;
@@ -264,14 +264,15 @@ public:
return false; \
} \
\
- static void to_string_bind(GDExtensionClassInstancePtr p_instance, GDNativeStringPtr r_out) { \
+ static void to_string_bind(GDExtensionClassInstancePtr p_instance, GDNativeBool *r_is_valid, GDNativeStringPtr r_out) { \
if (p_instance && m_class::_get_to_string()) { \
if (m_class::_get_to_string() != m_inherits::_get_to_string()) { \
m_class *cls = reinterpret_cast<m_class *>(p_instance); \
*reinterpret_cast<::godot::String *>(r_out) = cls->_to_string(); \
+ *r_is_valid = true; \
return; \
} \
- m_inherits::to_string_bind(p_instance, r_out); \
+ m_inherits::to_string_bind(p_instance, r_is_valid, r_out); \
} \
} \
\