From d9a3510512914f0897264f73b095e838507331b3 Mon Sep 17 00:00:00 2001 From: Cognition Date: Fri, 22 Jul 2022 23:05:14 -0600 Subject: [PATCH] Shocked autolathe will no longer infinitely zap you with menu open --- code/game/machinery/autolathe.dm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm index 35f45818b6..d18b5e54b5 100644 --- a/code/game/machinery/autolathe.dm +++ b/code/game/machinery/autolathe.dm @@ -62,14 +62,15 @@ if(!is_operational()) return - if(shocked && !(stat & NOPOWER)) - shock(user,50) - ui = SStgui.try_update_ui(user, src, ui) if(!ui) ui = new(user, src, "Autolathe", capitalize(src.name)) ui.open() + if(shocked && !(stat & NOPOWER)) + if(shock(user,50)) + ui.close() //close the window if they got zapped successfully as to prevent them from getting zapped infinitely. + /obj/machinery/autolathe/ui_data(mob/user) var/list/data = list() data["materials"] = list()