Merge pull request #110832 from Ivorforce/is-class-to-derives-from

Replace many uses of `is_class` with `derives_from`.
This commit is contained in:
Thaddeus Crews 2025-09-24 09:59:09 -05:00
commit 78b743cf4a
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC
43 changed files with 82 additions and 82 deletions

View file

@ -2220,7 +2220,7 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path, const Ref<Re
#ifdef REAL_T_IS_DOUBLE
format_flags |= FORMAT_FLAG_REAL_T_IS_DOUBLE;
#endif
if (!p_resource->is_class("PackedScene")) {
if (!p_resource->derives_from<PackedScene>()) {
Ref<Script> s = p_resource->get_script();
if (s.is_valid()) {
script_class = s->get_global_name();

View file

@ -1439,7 +1439,7 @@ bool ResourceLoader::add_custom_resource_format_loader(const String &script_path
Ref<Resource> res = ResourceLoader::load(script_path);
ERR_FAIL_COND_V(res.is_null(), false);
ERR_FAIL_COND_V(!res->is_class("Script"), false);
ERR_FAIL_COND_V(!res->derives_from<Script>(), false);
Ref<Script> s = res;
StringName ibt = s->get_instance_base_type();

View file

@ -233,7 +233,7 @@ bool ResourceSaver::add_custom_resource_format_saver(const String &script_path)
Ref<Resource> res = ResourceLoader::load(script_path);
ERR_FAIL_COND_V(res.is_null(), false);
ERR_FAIL_COND_V(!res->is_class("Script"), false);
ERR_FAIL_COND_V(!res->derives_from<Script>(), false);
Ref<Script> s = res;
StringName ibt = s->get_instance_base_type();