Skip to content

Commit cfd2b37

Browse files
committed
Merge pull request godotengine#111606 from YeldhamDev/out_of_the_field
Fix error when editing multifield values inside arrays and dictionaries
2 parents a6db8aa + 31efc7e commit cfd2b37

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

editor/debugger/editor_debugger_inspector.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,13 @@ void EditorDebuggerRemoteObjects::_get_property_list(List<PropertyInfo> *p_list)
9696
}
9797

9898
void EditorDebuggerRemoteObjects::set_property_field(const StringName &p_property, const Variant &p_value, const String &p_field) {
99-
_set_impl(p_property, p_value, p_field);
99+
// Ignore the field with arrays and dictionaries, as they are passed whole when edited.
100+
Variant::Type type = p_value.get_type();
101+
if (type == Variant::ARRAY || type == Variant::DICTIONARY) {
102+
_set_impl(p_property, p_value, "");
103+
} else {
104+
_set_impl(p_property, p_value, p_field);
105+
}
100106
}
101107

102108
String EditorDebuggerRemoteObjects::get_title() {

editor/inspector/multi_node_edit.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,13 @@ StringName MultiNodeEdit::get_edited_class_name() const {
337337
}
338338

339339
void MultiNodeEdit::set_property_field(const StringName &p_property, const Variant &p_value, const String &p_field) {
340-
_set_impl(p_property, p_value, p_field);
340+
// Ignore the field with arrays and dictionaries, as they are passed whole when edited.
341+
Variant::Type type = p_value.get_type();
342+
if (type == Variant::ARRAY || type == Variant::DICTIONARY) {
343+
_set_impl(p_property, p_value, "");
344+
} else {
345+
_set_impl(p_property, p_value, p_field);
346+
}
341347
}
342348

343349
void MultiNodeEdit::_bind_methods() {

0 commit comments

Comments
 (0)