Fixes unwrenching bug

This commit is contained in:
Kugamo
2020-09-03 12:36:58 -05:00
parent 0ccf04ba23
commit fa2a72e0eb

View File

@@ -187,24 +187,27 @@
icon_state = "scrubber:0"
/obj/machinery/portable_atmospherics/scrubber/huge/attackby(var/obj/item/W as obj, var/mob/user as mob, params)
if(istype(W, /obj/item/wrench))
if(stationary)
to_chat(user, "<span class='warning'>The bolts are too tight for you to unscrew!</span>")
return
if(on)
to_chat(user, "<span class='warning'>Turn it off first!</span>")
return
anchored = !anchored
playsound(loc, W.usesound, 50, 1)
to_chat(user, "<span class='notice'>You [anchored ? "wrench" : "unwrench"] \the [src].</span>")
return
if((istype(W, /obj/item/analyzer)) && get_dist(user, src) <= 1)
atmosanalyzer_scan(air_contents, user)
return
return ..()
/obj/machinery/portable_atmospherics/scrubber/huge/wrench_act(mob/user, obj/item/I)
. = TRUE
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
return
if(stationary)
to_chat(user, "<span class='warning'>The bolts are too tight for you to unscrew!</span>")
return
if(on)
to_chat(user, "<span class='warning'>Turn it off first!</span>")
return
anchored = !anchored
playsound(loc, I.usesound, 50, 1)
to_chat(user, "<span class='notice'>You [anchored ? "wrench" : "unwrench"] \the [src].</span>")
return
/obj/machinery/portable_atmospherics/scrubber/huge/stationary
name = "Stationary Air Scrubber"
stationary = 1