Merge pull request #15720 from BlueWildrose/autolatheshocks

Shocked autolathe will no longer infinitely zap you with the menu open
This commit is contained in:
Lin
2022-07-24 05:39:59 +00:00
committed by GitHub

View File

@@ -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()