Add protections against registering classes that didn't use GDCLASS()

(cherry picked from commit a61cdc8860)
This commit is contained in:
David Snopek
2023-10-21 17:54:46 -05:00
parent ef8a499eac
commit 9d813310bb
2 changed files with 16 additions and 0 deletions

View File

@@ -173,6 +173,7 @@ public:
template <class T, bool is_abstract>
void ClassDB::_register_class(bool p_virtual) {
static_assert(TypesAreSame<typename T::self_type, T>::value, "Class not declared properly, please use GDCLASS.");
instance_binding_callbacks[T::get_class_static()] = &T::_gde_binding_callbacks;
// Register this class within our plugin