From 46ab2512b83095f0a41fe3d84e7a5e3be797e80e Mon Sep 17 00:00:00 2001 From: Sergey Pershenkov Date: Thu, 19 May 2022 12:42:54 +0300 Subject: [PATCH] Return -1 from get_selected_id() when not selected Partial cherry pick from 3b146c5eaa06d9f6827c651802b9fb2a9a1e013d --- scene/gui/option_button.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/scene/gui/option_button.cpp b/scene/gui/option_button.cpp index 88889069879e..56f3d8ae6e05 100644 --- a/scene/gui/option_button.cpp +++ b/scene/gui/option_button.cpp @@ -258,12 +258,9 @@ int OptionButton::get_selected() const { } int OptionButton::get_selected_id() const { - int idx = get_selected(); - if (idx < 0) { - return 0; - } return get_item_id(current); } + Variant OptionButton::get_selected_metadata() const { int idx = get_selected(); if (idx < 0) {