|
46 | 46 | data["mixerDrinks"] = list() |
47 | 47 | data["storage"] = list() |
48 | 48 |
|
| 49 | + //Make sure food_ui_list has desired contents |
| 50 | + //This, combined with the find_amount() bellow, allow parmesan cheese to show in the UI after maturing |
| 51 | + for(var/obj/list_element in contents) |
| 52 | + //Only check food items |
| 53 | + if(istype(list_element, /obj/item/reagent_containers/food)) |
| 54 | + //Add to list if not already in it |
| 55 | + if(!LAZYFIND(food_ui_list, list_element.type)) |
| 56 | + LAZYADD(food_ui_list, list_element.type) |
| 57 | + |
49 | 58 |
|
50 | 59 | //Loop through food list for data to send to food tab |
51 | 60 | for(var/item_detail in food_ui_list) |
| 61 | + //If none are found in contents, remove from list and move on to next element |
| 62 | + if(find_amount(item_detail) == 0) |
| 63 | + LAZYREMOVE(food_ui_list, item_detail) |
| 64 | + continue |
| 65 | + |
52 | 66 | //Create needed list and variable for geting data for UI |
53 | 67 | var/list/details = list() |
54 | 68 | var/obj/item/reagent_containers/food/item = new item_detail |
|
195 | 209 | //Drop it on the floor and then move it into the user's hands |
196 | 210 | dispensed_item.forceMove(loc) |
197 | 211 | user.put_in_hands(dispensed_item) |
198 | | - user.visible_message(span_notice("[user] dispenses [ui_item.name] from [src]."), span_notice("You dispense [ui_item.name] from [src].")) |
| 212 | + user.visible_message(span_notice("[user] dispenses [dispensed_item.name] from [src]."), span_notice("You dispense [dispensed_item.name] from [src].")) |
199 | 213 | playsound(src, dispense_sound, 25, TRUE, extrarange = -3) |
200 | 214 | //If the last one was dispenced, remove from UI |
201 | 215 | if(find_amount(ui_item) == 0) |
|
0 commit comments