From 45d9ea57a7b9cfae12cfaf7f584907f7255c8bc5 Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Thu, 18 May 2017 12:06:22 -0500 Subject: [PATCH] Fixes fixing fire alarms (#996) --- code/game/machinery/firealarm.dm | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm index 447ff5f9bc..55d8b67582 100644 --- a/code/game/machinery/firealarm.dm +++ b/code/game/machinery/firealarm.dm @@ -153,6 +153,21 @@ return if(panel_open) + + if(istype(W, /obj/item/weapon/weldingtool) && user.a_intent == INTENT_HELP) + var/obj/item/weapon/weldingtool/WT = W + if(obj_integrity < max_integrity) + if(WT.remove_fuel(0,user)) + to_chat(user, "You begin repairing [src]...") + playsound(loc, WT.usesound, 40, 1) + if(do_after(user, 40*WT.toolspeed, target = src)) + obj_integrity = max_integrity + playsound(loc, 'sound/items/Welder2.ogg', 50, 1) + to_chat(user, "You repair [src].") + else + to_chat(user, "[src] is already in good condition!") + return + switch(buildstage) if(2) if(istype(W, /obj/item/device/multitool)) @@ -190,6 +205,7 @@ if(buildstage == 1) if(stat & BROKEN) to_chat(user, "You remove the destroyed circuit.") + stat &= ~BROKEN else to_chat(user, "You pry out the circuit.") new /obj/item/weapon/electronics/firealarm(user.loc) @@ -230,9 +246,10 @@ /obj/machinery/firealarm/deconstruct(disassembled = TRUE) if(!(flags & NODECONSTRUCT)) new /obj/item/stack/sheet/metal(loc, 1) - var/obj/item/I = new /obj/item/weapon/electronics/firealarm(loc) - if(!disassembled) - I.obj_integrity = I.max_integrity * 0.5 + if(!(stat & BROKEN)) + var/obj/item/I = new /obj/item/weapon/electronics/firealarm(loc) + if(!disassembled) + I.obj_integrity = I.max_integrity * 0.5 new /obj/item/stack/cable_coil(loc, 3) qdel(src)