From 5c35e4e6d442a9b8e305ad04fa43738c07aef50b Mon Sep 17 00:00:00 2001 From: Adrer Date: Mon, 16 Nov 2020 11:15:02 +0100 Subject: [PATCH] Autolathe disable wire actually disables autolathe (#14903) * Autolathe disable wire actually disables autolathe * Cutting wire disables TGUI instead of closing it. * Now disabled TGUI instead of closing it * Queue emptying statement now actually valid Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com> * Minor spacing fix Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com> Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com> --- code/game/machinery/autolathe.dm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm index 96c8ccff074..7d57c2edebe 100644 --- a/code/game/machinery/autolathe.dm +++ b/code/game/machinery/autolathe.dm @@ -79,7 +79,7 @@ if(panel_open) wires.Interact(user) - else + else if(!disabled) tgui_interact(user) /obj/machinery/autolathe/tgui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = TRUE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state) @@ -202,6 +202,11 @@ process_queue() busy = FALSE +/obj/machinery/autolathe/tgui_status(mob/user, datum/tgui_state/state) + . = disabled ? STATUS_DISABLED : STATUS_INTERACTIVE + + return min(..(), .) + /obj/machinery/autolathe/proc/design_cost_data(datum/design/D) var/list/data = list() var/coeff = get_coeff(D) @@ -445,7 +450,7 @@ else return while(D) - if(stat & (NOPOWER|BROKEN)) + if((stat & (NOPOWER|BROKEN)) || disabled) being_built = new /list() return 0 if(!can_build(D, multiplier))