summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2022-08-10 11:50:20 +0200
committerGitHub <noreply@github.com>2022-08-10 11:50:20 +0200
commit6b84619136d4748a13d7710feb0313cbade502c5 (patch)
treea544ea7181424a2c2060492a9d479d428bfab504
parentedf07ee7a66ae4405c80b658434ee53f85e8fa88 (diff)
parentfe16aecbacaef37b8a56de34c9cb5a69f7a26644 (diff)
Merge pull request #64188 from YeldhamDev/gridmap_item_fix
-rw-r--r--modules/gridmap/editor/grid_map_editor_plugin.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/gridmap/editor/grid_map_editor_plugin.cpp b/modules/gridmap/editor/grid_map_editor_plugin.cpp
index 09f0ff32f0..518e2cf97d 100644
--- a/modules/gridmap/editor/grid_map_editor_plugin.cpp
+++ b/modules/gridmap/editor/grid_map_editor_plugin.cpp
@@ -896,10 +896,12 @@ void GridMapEditor::update_palette() {
}
if (selected != -1 && mesh_library_palette->get_item_count() > 0) {
- mesh_library_palette->select(selected);
+ // Make sure that this variable is set correctly.
+ selected_palette = MIN(selected, mesh_library_palette->get_item_count() - 1);
+ mesh_library_palette->select(selected_palette);
}
- last_mesh_library = mesh_library.operator->();
+ last_mesh_library = *mesh_library;
}
void GridMapEditor::edit(GridMap *p_gridmap) {