From 432478cb703fe4b556d477633eaebae739d6be5f Mon Sep 17 00:00:00 2001 From: Relintai Date: Sat, 9 Mar 2024 16:42:13 +0100 Subject: [PATCH] Fix index error. --- .../layered_tile_map/editor/layered_tile_map_layer_editor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/layered_tile_map/editor/layered_tile_map_layer_editor.cpp b/modules/layered_tile_map/editor/layered_tile_map_layer_editor.cpp index 255359f73a..fabd47eaa5 100644 --- a/modules/layered_tile_map/editor/layered_tile_map_layer_editor.cpp +++ b/modules/layered_tile_map/editor/layered_tile_map_layer_editor.cpp @@ -3527,7 +3527,7 @@ void LayeredTileMapLayerEditorTerrainsPlugin::_update_tiles_list() { terrains_tile_list->set_item_metadata(item_index, list_metadata_dict); terrains_tile_list->add_icon_item(main_vbox_container->get_theme_icon("TerrainPath", "EditorIcons")); - item_index = terrains_tile_list->get_item_count(); + item_index = terrains_tile_list->get_item_count() - 1; terrains_tile_list->set_item_tooltip(item_index, TTR("Path mode: paints a terrain, then connects it to the previous tile painted within the same stroke.")); list_metadata_dict = Dictionary(); list_metadata_dict["type"] = SELECTED_TYPE_PATH;