From 6c28c381cf6e0f1180e03c259a14f05287d138b1 Mon Sep 17 00:00:00 2001 From: Antoonij <42318445+Antoonij@users.noreply.github.com> Date: Wed, 11 Dec 2024 12:38:26 +0100 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kitchen_machinery/kitchen_machine.dm | 24 ++++++++++----- .../chemistry/machinery/reagentgrinder.dm | 30 +++++++++++-------- 2 files changed, 34 insertions(+), 20 deletions(-) diff --git a/code/modules/food_and_drinks/kitchen_machinery/kitchen_machine.dm b/code/modules/food_and_drinks/kitchen_machinery/kitchen_machine.dm index 9d5549f8b22..c00567646d8 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/kitchen_machine.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/kitchen_machine.dm @@ -147,33 +147,37 @@ to_chat(user, span_warning("You have no idea how to cook with [I].")) return ATTACK_CHAIN_PROCEED|ATTACK_CHAIN_NO_AFTERATTACK -/obj/machinery/kitchen_machine/AltClick(mob/user) - var/mob/living/carbon/human/human = user +/obj/machinery/kitchen_machine/AltClick(mob/living/carbon/human/human) if(!istype(human)) return + if(!Adjacent(human)) return + if(human.incapacitated() || HAS_TRAIT(human, TRAIT_HANDS_BLOCKED)) return + if(operating) return - add_fingerprint(user) + add_fingerprint(human) cook() -/obj/machinery/kitchen_machine/CtrlShiftClick(mob/user) - var/mob/living/carbon/human/human = user +/obj/machinery/kitchen_machine/CtrlShiftClick(mob/living/carbon/human/human) if(!istype(human)) return + if(!Adjacent(human)) return + if(human.incapacitated() || HAS_TRAIT(human, TRAIT_HANDS_BLOCKED)) return + if(operating) return - add_fingerprint(user) - dispose(user) + add_fingerprint(human) + dispose(human) /obj/machinery/kitchen_machine/screwdriver_act(mob/living/user, obj/item/I) . = TRUE @@ -488,10 +492,13 @@ /obj/machinery/kitchen_machine/proc/dispose(mob/user) for(var/obj/O in contents) O.forceMove(loc) + if(reagents.total_volume) dirty++ + reagents.clear_reagents() - to_chat(user, "You dispose of \the [src]'s contents.") + to_chat(user, span_notice("You dispose of \the [src]'s contents.")) + updateUsrDialog() /obj/machinery/kitchen_machine/proc/muck_start() @@ -553,6 +560,7 @@ if("dispose") dispose(usr) + return diff --git a/code/modules/reagents/chemistry/machinery/reagentgrinder.dm b/code/modules/reagents/chemistry/machinery/reagentgrinder.dm index 754007d7543..6802b904d6b 100644 --- a/code/modules/reagents/chemistry/machinery/reagentgrinder.dm +++ b/code/modules/reagents/chemistry/machinery/reagentgrinder.dm @@ -231,33 +231,37 @@ updateUsrDialog() return ATTACK_CHAIN_BLOCKED_ALL -/obj/machinery/reagentgrinder/AltClick(mob/user) - var/mob/living/carbon/human/human = user +/obj/machinery/reagentgrinder/AltClick(mob/living/carbon/human/human) if(!istype(human)) return + if(!Adjacent(human)) return + if(human.incapacitated() || HAS_TRAIT(human, TRAIT_HANDS_BLOCKED)) return + if(operating) return - add_fingerprint(user) + add_fingerprint(human) grind() -/obj/machinery/reagentgrinder/CtrlShiftClick(mob/user) - var/mob/living/carbon/human/human = user +/obj/machinery/reagentgrinder/CtrlShiftClick(mob/living/carbon/human/human) if(!istype(human)) return + if(!Adjacent(human)) return + if(human.incapacitated() || HAS_TRAIT(human, TRAIT_HANDS_BLOCKED)) return + if(operating) return - add_fingerprint(user) - detach() + add_fingerprint(human) + detach(human) /obj/machinery/reagentgrinder/attack_ai(mob/user) return FALSE @@ -330,16 +334,18 @@ if("eject") eject() if ("detach") - detach() + detach(usr) -/obj/machinery/reagentgrinder/proc/detach() +/obj/machinery/reagentgrinder/proc/detach(mob/user) + if(user.stat) + return - if (usr.stat != 0) - return if (!beaker) - return + return + beaker.loc = src.loc beaker = null + update_icon(UPDATE_ICON_STATE) updateUsrDialog()