From 082a713848ad4e91c784bcc42d125ba5874edac5 Mon Sep 17 00:00:00 2001 From: YPOQ <30683121+YPOQ@users.noreply.github.com> Date: Sun, 22 Oct 2017 16:52:51 -0600 Subject: [PATCH] Composting plants/pills transfers all reagents (#31923) --- code/modules/hydroponics/hydroponics.dm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm index 5dd9627c2d..c774e4574a 100644 --- a/code/modules/hydroponics/hydroponics.dm +++ b/code/modules/hydroponics/hydroponics.dm @@ -693,10 +693,13 @@ var/target = myseed ? myseed.plantname : src var/visi_msg = "" var/irrigate = 0 //How am I supposed to irrigate pill contents? + var/transfer_amount if(istype(reagent_source, /obj/item/reagent_containers/food/snacks) || istype(reagent_source, /obj/item/reagent_containers/pill)) visi_msg="[user] composts [reagent_source], spreading it through [target]" + transfer_amount = reagent_source.reagents.total_volume else + transfer_amount = reagent_source.amount_per_transfer_from_this if(istype(reagent_source, /obj/item/reagent_containers/syringe/)) var/obj/item/reagent_containers/syringe/syr = reagent_source visi_msg="[user] injects [target] with [syr]" @@ -706,14 +709,14 @@ visi_msg="[user] sprays [target] with [reagent_source]" playsound(loc, 'sound/effects/spray3.ogg', 50, 1, -6) irrigate = 1 - else if(reagent_source.amount_per_transfer_from_this) // Droppers, cans, beakers, what have you. + else if(transfer_amount) // Droppers, cans, beakers, what have you. visi_msg="[user] uses [reagent_source] on [target]" irrigate = 1 // Beakers, bottles, buckets, etc. Can't use is_open_container though. if(istype(reagent_source, /obj/item/reagent_containers/glass/)) playsound(loc, 'sound/effects/slosh.ogg', 25, 1) - if(irrigate && reagent_source.amount_per_transfer_from_this > 30 && reagent_source.reagents.total_volume >= 30 && using_irrigation) + if(irrigate && transfer_amount > 30 && reagent_source.reagents.total_volume >= 30 && using_irrigation) trays = FindConnected() if (trays.len > 1) visi_msg += ", setting off the irrigation system" @@ -721,7 +724,7 @@ if(visi_msg) visible_message("[visi_msg].") - var/split = round(reagent_source.amount_per_transfer_from_this/trays.len) + var/split = round(transfer_amount/trays.len) for(var/obj/machinery/hydroponics/H in trays) //cause I don't want to feel like im juggling 15 tamagotchis and I can get to my real work of ripping flooring apart in hopes of validating my life choices of becoming a space-gardener