瀏覽代碼

Return -1 from get_selected_id() when not selected

Partial cherry pick from 3b146c5eaa06d9f6827c651802b9fb2a9a1e013d
Sergey Pershenkov 3 年之前
父節點
當前提交
46ab2512b8
共有 1 個文件被更改,包括 1 次插入4 次删除
  1. 1 4
      scene/gui/option_button.cpp

+ 1 - 4
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) {