Fix ResourceSaver saving default value

This commit is contained in:
Ozelot Vanilla 2025-06-02 22:21:14 +09:00
parent 64b09905c7
commit 3772e7690d

View file

@ -34,6 +34,7 @@
#include "core/io/dir_access.h"
#include "core/io/missing_resource.h"
#include "core/object/script_language.h"
#include "scene/property_utils.h"
void ResourceLoaderText::_printerr() {
ERR_PRINT(vformat("%s:%d - Parse Error: %s.", res_path, lines, error_text));
@ -1935,7 +1936,7 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path, const Ref<Reso
}
}
Variant default_value = ClassDB::class_get_default_property_value(res->get_class(), name);
Variant default_value = 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;