Compare commits
3 Commits
9168b89a53
...
04c46ac573
Author | SHA1 | Date |
---|---|---|
|
04c46ac573 | |
|
ab3db91c92 | |
|
321c8d2b30 |
|
@ -152,12 +152,20 @@ template <class T>
|
|||
class ClassCreator {
|
||||
public:
|
||||
static GDExtensionObjectPtr create(void *data) {
|
||||
T *new_object = memnew(T);
|
||||
return new_object->_owner;
|
||||
if constexpr (!std::is_abstract_v<T>) {
|
||||
T *new_object = memnew(T);
|
||||
return new_object->_owner;
|
||||
} else {
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
static GDExtensionClassInstancePtr recreate(void *data, GDExtensionObjectPtr obj) {
|
||||
_GDCLASS_RECREATE(T)
|
||||
if constexpr (!std::is_abstract_v<T>) {
|
||||
_GDCLASS_RECREATE(T)
|
||||
} else {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue