From f86ab4031a8d5044ecf2ba79dc40bf6906156a48 Mon Sep 17 00:00:00 2001 From: Jean-Michel Bernard Date: Fri, 4 Feb 2022 19:08:10 +0100 Subject: [PATCH] Fix template OptionButton in create script dialog doesn't select the correct template --- editor/script_create_dialog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp index 0c916bf56ae..cafa12c42e3 100644 --- a/editor/script_create_dialog.cpp +++ b/editor/script_create_dialog.cpp @@ -763,10 +763,10 @@ void ScriptCreateDialog::_update_dialog() { } ScriptLanguage::ScriptTemplate ScriptCreateDialog::_get_current_template() const { - int selected_id = template_menu->get_selected_id(); + int selected_index = template_menu->get_selected(); for (const ScriptLanguage::ScriptTemplate &t : template_list) { if (is_using_templates) { - if (t.id == selected_id) { + if (t.id == selected_index) { return t; } } else {