Merge pull request #64188 from YeldhamDev/gridmap_item_fix

This commit is contained in:
Rémi Verschelde 2022-08-10 11:50:20 +02:00 committed by GitHub
commit 6b84619136
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -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) {