Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 6e53ae1

Browse files
hedgehog1029's suggested changes
1 parent 78c215c commit 6e53ae1

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

code/modules/food_and_drinks/kitchen_machinery/food_cart.dm

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,10 @@
173173
else if(istype(A, /obj/item/reagent_containers/food/drinks/drinkingglass))
174174
//Check if glass is empty
175175
if(!A.reagents.total_volume)
176-
//Delete glass and increment glass_quantity by 1
177-
qdel(A)
176+
//Increment glass_quantity by 1 and then delete glass
178177
glass_quantity++
179178
user.visible_message(span_notice("[user] inserts [A] into [src]."), span_notice("You insert [A] into [src]."))
179+
qdel(A)
180180
playsound(src, insert_sound, 50, TRUE, extrarange = -3)
181181
return
182182
else if(A.is_drainable())
@@ -185,7 +185,7 @@
185185
..()
186186

187187
/obj/machinery/food_cart/proc/dispense_item(received_item, mob/user = usr)
188-
//Make a variable for checking the type of the selected item
188+
//Make a variable for checking amount of item
189189
var/obj/item/reagent_containers/food/ui_item = new received_item
190190

191191
//If the vat has some of the desired item, dispense it
@@ -201,9 +201,12 @@
201201
if(find_amount(ui_item) == 0)
202202
LAZYREMOVE(food_ui_list, received_item)
203203
else
204-
//For Alt click and because UI buttons are slow to disable themselves
204+
//Incase the UI buttons are slow to disable themselves
205205
user.balloon_alert(user, "All out!")
206206

207+
//Delete instance
208+
qdel(ui_item)
209+
207210
/obj/machinery/food_cart/proc/storage_single(obj/item/target_item, mob/user = usr)
208211
//Check if there is room
209212
if(contents.len - 1 < contents_capacity)

0 commit comments

Comments
 (0)