From 9a69922a86b21432e0d7dae64515dca98c2bd4df Mon Sep 17 00:00:00 2001 From: Markolie Date: Sat, 18 Feb 2017 15:58:38 +0100 Subject: [PATCH] Fix slicing disposal pipes not showing a progress bar --- code/modules/recycling/disposal.dm | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index 622fe780031..b9cb76b31b0 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -872,29 +872,22 @@ //weldingtool: unfasten and convert to obj/disposalconstruct /obj/structure/disposalpipe/attackby(var/obj/item/I, var/mob/user, params) - - var/turf/T = src.loc + var/turf/T = get_turf(src) if(T.intact) return // prevent interaction with T-scanner revealed pipes - src.add_fingerprint(user) + + add_fingerprint(user) + if(istype(I, /obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/W = I - - if(W.remove_fuel(0,user)) - playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1) - // check if anything changed over 2 seconds - var/turf/uloc = user.loc - var/atom/wloc = W.loc - to_chat(user, "Slicing the disposal pipe.") - sleep(30) - if(!W.isOn()) return - if(user.loc == uloc && wloc == W.loc) + if(W.remove_fuel(0, user)) + to_chat(user, "You begin slicing \the [src].") + playsound(loc, 'sound/items/Welder2.ogg', 100, 1) + if(do_after(user, 30, target = src)) + to_chat(user, "You finish slicing \the [src].") welded() - else - to_chat(user, "You must stay still while welding the pipe.") else - to_chat(user, "You need more welding fuel to cut the pipe.") - return + to_chat(user, "You need more welding fuel to cut the pipe.") // called when pipe is cut with welder /obj/structure/disposalpipe/proc/welded()