mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 00:13:30 +00:00
Merge pull request #93942 from MikeSchulze/73525
Fix GDScript analyzer error when instantiating EditorPlugins.
This commit is contained in:
commit
fe5d567917
3 changed files with 17 additions and 1 deletions
|
@ -683,6 +683,21 @@ bool ClassDB::can_instantiate(const StringName &p_class) {
|
|||
return (!ti->disabled && ti->creation_func != nullptr && !(ti->gdextension && !ti->gdextension->create_instance));
|
||||
}
|
||||
|
||||
bool ClassDB::is_abstract(const StringName &p_class) {
|
||||
OBJTYPE_RLOCK;
|
||||
|
||||
ClassInfo *ti = classes.getptr(p_class);
|
||||
if (!ti) {
|
||||
if (!ScriptServer::is_global_class(p_class)) {
|
||||
ERR_FAIL_V_MSG(false, "Cannot get class '" + String(p_class) + "'.");
|
||||
}
|
||||
String path = ScriptServer::get_global_class_path(p_class);
|
||||
Ref<Script> scr = ResourceLoader::load(path);
|
||||
return scr.is_valid() && scr->is_valid() && scr->is_abstract();
|
||||
}
|
||||
return ti->creation_func == nullptr && (!ti->gdextension || ti->gdextension->create_instance == nullptr);
|
||||
}
|
||||
|
||||
bool ClassDB::is_virtual(const StringName &p_class) {
|
||||
OBJTYPE_RLOCK;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue