diff options
author | Chris Cranford <chris@hibernate.org> | 2024-07-31 20:06:07 -0400 |
---|---|---|
committer | Chris Cranford <chris@hibernate.org> | 2024-08-01 12:03:27 -0400 |
commit | c77d44f3f6abbacfc5b4a5efff580387e8b297b8 (patch) | |
tree | 2783e082b1fc1b47e4f610df808bb5f5d73516c4 | |
parent | f2b521f55a0a2ba7080418ba898b97028da6134a (diff) | |
download | redot-cpp-c77d44f3f6abbacfc5b4a5efff580387e8b297b8.tar.gz |
Make sure `_get` and `_set` dispatch up the class hierarchy
-rw-r--r-- | include/godot_cpp/classes/wrapped.hpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/include/godot_cpp/classes/wrapped.hpp b/include/godot_cpp/classes/wrapped.hpp index 9cc1d39..6d9bef7 100644 --- a/include/godot_cpp/classes/wrapped.hpp +++ b/include/godot_cpp/classes/wrapped.hpp @@ -274,23 +274,27 @@ public: } \ \ static GDExtensionBool set_bind(GDExtensionClassInstancePtr p_instance, GDExtensionConstStringNamePtr p_name, GDExtensionConstVariantPtr p_value) { \ - if (p_instance && m_class::_get_set()) { \ + if (p_instance) { \ + if (m_inherits::set_bind(p_instance, p_name, p_value)) { \ + return true; \ + } \ if (m_class::_get_set() != m_inherits::_get_set()) { \ m_class *cls = reinterpret_cast<m_class *>(p_instance); \ return cls->_set(*reinterpret_cast<const ::godot::StringName *>(p_name), *reinterpret_cast<const ::godot::Variant *>(p_value)); \ } \ - return m_inherits::set_bind(p_instance, p_name, p_value); \ } \ return false; \ } \ \ static GDExtensionBool get_bind(GDExtensionClassInstancePtr p_instance, GDExtensionConstStringNamePtr p_name, GDExtensionVariantPtr r_ret) { \ - if (p_instance && m_class::_get_get()) { \ + if (p_instance) { \ + if (m_inherits::get_bind(p_instance, p_name, r_ret)) { \ + return true; \ + } \ if (m_class::_get_get() != m_inherits::_get_get()) { \ m_class *cls = reinterpret_cast<m_class *>(p_instance); \ return cls->_get(*reinterpret_cast<const ::godot::StringName *>(p_name), *reinterpret_cast<::godot::Variant *>(r_ret)); \ } \ - return m_inherits::get_bind(p_instance, p_name, r_ret); \ } \ return false; \ } \ |