mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Chemistry machinery fixes.
Makes Topic() calls check parent. Adds proper operable() checks where applicable. Makes the interact_offline only affect the NOPOWER flag. Fixes #11116. Fixes #11302.
This commit is contained in:
@@ -195,7 +195,10 @@ Class Procs:
|
||||
return (stat & (NOPOWER|BROKEN|additional_flags))
|
||||
|
||||
/obj/machinery/CanUseTopic(var/mob/user)
|
||||
if(!interact_offline && (stat & (NOPOWER|BROKEN)))
|
||||
if(stat & BROKEN)
|
||||
return STATUS_CLOSE
|
||||
|
||||
if(!interact_offline && (stat & NOPOWER))
|
||||
return STATUS_CLOSE
|
||||
|
||||
return ..()
|
||||
|
||||
@@ -80,13 +80,8 @@
|
||||
return
|
||||
|
||||
/obj/machinery/chem_master/Topic(href, href_list)
|
||||
if(stat & (BROKEN|NOPOWER)) return
|
||||
if(usr.stat || usr.restrained()) return
|
||||
if(!in_range(src, usr)) return
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
usr.set_machine(src)
|
||||
|
||||
if(..())
|
||||
return 1
|
||||
|
||||
if (href_list["ejectp"])
|
||||
if(loaded_pill_bottle)
|
||||
@@ -236,7 +231,7 @@
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/chem_master/attack_hand(mob/user as mob)
|
||||
if(stat & BROKEN)
|
||||
if(inoperable())
|
||||
return
|
||||
user.set_machine(src)
|
||||
if(!(user.client in has_sprites))
|
||||
@@ -345,11 +340,8 @@
|
||||
|
||||
|
||||
/obj/machinery/computer/pandemic/Topic(href, href_list)
|
||||
if(stat & (NOPOWER|BROKEN)) return
|
||||
if(usr.stat || usr.restrained()) return
|
||||
if(!in_range(src, usr)) return
|
||||
|
||||
usr.set_machine(src)
|
||||
if(..())
|
||||
return 1
|
||||
if(!beaker) return
|
||||
|
||||
if (href_list["create_vaccine"])
|
||||
@@ -657,10 +649,12 @@
|
||||
return 0
|
||||
|
||||
/obj/machinery/reagentgrinder/attack_hand(mob/user as mob)
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/reagentgrinder/interact(mob/user as mob) // The microwave Menu
|
||||
if(inoperable())
|
||||
return
|
||||
user.set_machine(src)
|
||||
var/is_chamber_empty = 0
|
||||
var/is_beaker_ready = 0
|
||||
var/processing_chamber = ""
|
||||
@@ -707,8 +701,8 @@
|
||||
|
||||
/obj/machinery/reagentgrinder/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.set_machine(src)
|
||||
return 1
|
||||
|
||||
switch(href_list["action"])
|
||||
if ("grind")
|
||||
grind()
|
||||
@@ -717,7 +711,7 @@
|
||||
if ("detach")
|
||||
detach()
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
return 1
|
||||
|
||||
/obj/machinery/reagentgrinder/proc/detach()
|
||||
|
||||
|
||||
@@ -113,9 +113,6 @@
|
||||
return ..()
|
||||
|
||||
/obj/machinery/chemical_dispenser/ui_interact(mob/user, ui_key = "main",var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
if(stat & (BROKEN|NOPOWER)) return
|
||||
if(user.stat || user.restrained()) return
|
||||
|
||||
// this is the data which will be sent to the ui
|
||||
var/data[0]
|
||||
data["amount"] = amount
|
||||
@@ -148,8 +145,8 @@
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/chemical_dispenser/Topic(href, href_list)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return 0 // don't update UIs attached to this object
|
||||
if(..())
|
||||
return 1
|
||||
|
||||
if(href_list["amount"])
|
||||
amount = round(text2num(href_list["amount"]), 1) // round to nearest 1
|
||||
@@ -171,9 +168,7 @@
|
||||
return 1 // update UIs attached to this object
|
||||
|
||||
/obj/machinery/chemical_dispenser/attack_ai(mob/user as mob)
|
||||
src.attack_hand(user)
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/chemical_dispenser/attack_hand(mob/user as mob)
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
ui_interact(user)
|
||||
|
||||
Reference in New Issue
Block a user