You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-12 13:20:55 +00:00
Merge pull request #107049 from OzelotVanilla/fix-resourcesaver-saving-default-value
Fix `ResourceSaver` saving default value of `Resource`
This commit is contained in:
@@ -34,6 +34,7 @@
|
|||||||
#include "core/io/dir_access.h"
|
#include "core/io/dir_access.h"
|
||||||
#include "core/io/missing_resource.h"
|
#include "core/io/missing_resource.h"
|
||||||
#include "core/object/script_language.h"
|
#include "core/object/script_language.h"
|
||||||
|
#include "scene/property_utils.h"
|
||||||
|
|
||||||
void ResourceLoaderText::_printerr() {
|
void ResourceLoaderText::_printerr() {
|
||||||
ERR_PRINT(vformat("%s:%d - Parse Error: %s.", res_path, lines, error_text));
|
ERR_PRINT(vformat("%s:%d - Parse Error: %s.", res_path, lines, error_text));
|
||||||
@@ -1930,7 +1931,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))) {
|
if (default_value.get_type() != Variant::NIL && bool(Variant::evaluate(Variant::OP_EQUAL, value, default_value))) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user