From 33b7cf4031ad699d6cb2f877781e9c24bd933278 Mon Sep 17 00:00:00 2001 From: Haz Date: Thu, 25 Feb 2021 19:06:32 -0500 Subject: [PATCH] Fix mesh library remove selected item menu option Fixes #45969. (cherry picked from commits 189acbee60f3d3149577db5446d9115352f60216 and aa9d2149e74233b834d168a725c8b119cc72619c) --- modules/gridmap/mesh_library_editor_plugin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/gridmap/mesh_library_editor_plugin.cpp b/modules/gridmap/mesh_library_editor_plugin.cpp index 4b843d598..15010efbb 100644 --- a/modules/gridmap/mesh_library_editor_plugin.cpp +++ b/modules/gridmap/mesh_library_editor_plugin.cpp @@ -248,8 +248,8 @@ void MeshLibraryEditor::_menu_cbk(int p_option) { } break; case MENU_OPTION_REMOVE_ITEM: { String p = editor->get_inspector()->get_selected_path(); - if (p.begins_with("/MeshLibrary/item") && p.get_slice_count("/") >= 3) { - to_erase = p.get_slice("/", 3).to_int(); + if (p.begins_with("item") && p.get_slice_count("/") >= 2) { + to_erase = p.get_slice("/", 1).to_int(); cd_remove->set_text(vformat(TTR("Remove item %d?"), to_erase)); cd_remove->popup_centered(Size2(300, 60)); }