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

Commit be71f2a

Browse files
Cart now spills liquids when destroyed
1 parent 6d098ec commit be71f2a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

code/modules/food_and_drinks/kitchen_machinery/food_cart.dm

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
playsound(src, select_sound, 50, TRUE, extrarange = -3)
134134
//Add reagent to mixer
135135
if("addMixer")
136-
src.reagents.trans_id_to(mixer, text2path(params["itemPath"]), selected_transfer)
136+
reagents.trans_id_to(mixer, text2path(params["itemPath"]), selected_transfer)
137137
playsound(src, select_sound, 50, TRUE, extrarange = -3)
138138
//Return reagent to storage
139139
if("transferBack")
@@ -148,19 +148,19 @@
148148
//Create reagents holder for drinks
149149
create_reagents(reagent_capacity, OPENCONTAINER | NO_REACT)
150150
mixer = new /obj/item/reagent_containers(src, 50)
151-
mixer.reagent_flags = NO_REACT | SPILLABLE
151+
mixer.create_reagents(50, NO_REACT)
152152

153153
/obj/machinery/food_cart/Destroy()
154-
//Increase the mixer's volume to hold all of cart's reagents and set its name to cart's name
155-
mixer.volume += reagent_capacity
156-
mixer.name = name
157-
//Move all reagents in cart to mixer
158-
src.reagents.trans_to(mixer, reagent_capacity)
159-
mixer.loc = src.loc
160-
//Spill the contents of the mixer
161-
mixer.SplashReagents(src.loc, TRUE)
154+
//Only alert others if the cart or mixer has any reagents
155+
if(mixer.reagents.total_volume > 0 || reagents.total_volume > 0)
156+
visible_message(span_alert("[src] spills all of its liquids onto the floor!"))
157+
//Spill reagents on the cart's turf
158+
var/turf/spill_area = loc
159+
spill_area.add_liquid_from_reagents(mixer.reagents, FALSE, mixer.reagents.chem_temp)
160+
spill_area.add_liquid_from_reagents(reagents, FALSE, mixer.reagents.chem_temp)
162161
//Reduce mixer to dust
163162
QDEL_NULL(mixer)
163+
164164
return ..()
165165

166166
//For adding items and reagents to storage

0 commit comments

Comments
 (0)