mirror of
https://github.com/godotengine/godot
synced 2024-09-04 22:08:29 +00:00
Inheriting from virtual class no longer causes the engine to crash, it prints an error instead.
Co-authored-by: Hein-Pieter van Braam <hp@tmm.cx>
This commit is contained in:
parent
07498d313c
commit
8f22c2684f
|
@ -152,12 +152,13 @@ Variant GDScript::_new(const Variant **p_args, int p_argcount, Variant::CallErro
|
|||
}
|
||||
|
||||
ERR_FAIL_COND_V(_baseptr->native.is_null(), Variant());
|
||||
|
||||
if (_baseptr->native.ptr()) {
|
||||
owner = _baseptr->native->instance();
|
||||
} else {
|
||||
owner = memnew(Reference); //by default, no base means use reference
|
||||
}
|
||||
ERR_EXPLAIN("Can't inherit from a virtual class");
|
||||
ERR_FAIL_COND_V(!owner, Variant());
|
||||
|
||||
Reference *r = Object::cast_to<Reference>(owner);
|
||||
if (r) {
|
||||
|
|
Loading…
Reference in a new issue