Fix error when switching to another GridMap
with an item with higher index selected
This commit is contained in:
parent
9da08cecbd
commit
fe16aecbac
1 changed files with 4 additions and 2 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue