Fix script property of custom resources inherited from scripts are not saved

This commit is contained in:
LuoZhihao
2025-06-10 23:03:13 +08:00
parent fc523ec5f6
commit 784823ada1
2 changed files with 5 additions and 2 deletions
+2 -1
View File
@@ -1931,7 +1931,8 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path, const Ref<Reso
}
}
Variant default_value = PropertyUtils::get_property_default_value(res.ptr(), name);
bool is_script = name == CoreStringName(script);
Variant default_value = is_script ? Variant() : PropertyUtils::get_property_default_value(res.ptr(), name);
if (default_value.get_type() != Variant::NIL && bool(Variant::evaluate(Variant::OP_EQUAL, value, default_value))) {
continue;