Merge pull request #42616 from Calinou/project-settings-no-object

Don't allow adding Objects to the project settings
This commit is contained in:
Rémi Verschelde 2021-01-11 11:27:08 +01:00 committed by GitHub
commit 43ab640483
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -381,9 +381,12 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) {
type->set_custom_minimum_size(Size2(100, 0) * EDSCALE);
hbc->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)));
}
}
l = memnew(Label);