Forráskód Böngészése

Fix error spam when typing in the TileMap editor's search box while having no results

(cherry picked from commit 412a0b73e9291b10a89780014c66947a2588ea85)
Michael Alexsander Silva Dias 6 éve
szülő
commit
1804a726b4
1 módosított fájl, 1 hozzáadás és 1 törlés
  1. 1 1
      editor/plugins/tile_map_editor_plugin.cpp

+ 1 - 1
editor/plugins/tile_map_editor_plugin.cpp

@@ -472,7 +472,7 @@ void TileMapEditor::_update_palette() {
 	if (selected.get(0) != TileMap::INVALID_CELL) {
 	if (selected.get(0) != TileMap::INVALID_CELL) {
 		set_selected_tiles(selected);
 		set_selected_tiles(selected);
 		sel_tile = selected.get(Math::rand() % selected.size());
 		sel_tile = selected.get(Math::rand() % selected.size());
-	} else {
+	} else if (palette->get_item_count() > 0) {
 		palette->select(0);
 		palette->select(0);
 	}
 	}