mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Merge pull request #26034 from QbieShay/issue_25596
Inheriting from virtual class no longer causes the engine to crash.
This commit is contained in:
commit
f2003b1a7e
1 changed files with 2 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue