浏览代码

Fix Variant properties losing value upon script update

kobewi 2 月之前
父节点
当前提交
188e313dd8
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      core/object/script_language.cpp

+ 1 - 1
core/object/script_language.cpp

@@ -795,7 +795,7 @@ void PlaceHolderScriptInstance::update(const List<PropertyInfo> &p_properties, c
 		StringName n = E.name;
 		new_values.insert(n);
 
-		if (!values.has(n) || values[n].get_type() != E.type) {
+		if (!values.has(n) || (E.type != Variant::NIL && values[n].get_type() != E.type)) {
 			if (p_values.has(n)) {
 				values[n] = p_values[n];
 			}