From 952a0895519fdc92e6e1a3952ef4594ef3dc441f Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Wed, 7 Oct 2020 14:27:25 +0200 Subject: [PATCH] Don't allow adding Objects to the project settings Godot doesn't support serializing objects. This closes #33667. (cherry picked from commit 7b84f4fc31f40f88575ca7805852d1be9dec3f81) --- editor/project_settings_editor.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index c68ef063e96..c03d71ee000 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -1827,9 +1827,12 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { type->set_h_size_flags(Control::SIZE_EXPAND_FILL); add_prop_bar->add_child(type); - // Start at 1 to avoid adding "Nil" as an option - for (int i = 1; i < Variant::VARIANT_MAX; i++) { - type->add_item(Variant::get_type_name(Variant::Type(i))); + for (int i = 0; i < Variant::VARIANT_MAX; i++) { + // There's no point in adding Nil types, and Object types + // can't be serialized correctly in the project settings. + if (i != Variant::NIL && i != Variant::OBJECT) { + type->add_item(Variant::get_type_name(Variant::Type(i))); + } } Button *add = memnew(Button);