From 6bb146262caef774e94030db8d5cef8493c67fc1 Mon Sep 17 00:00:00 2001 From: "aranclanos@hotmail.com" Date: Mon, 7 Jan 2013 11:44:31 +0000 Subject: [PATCH] Runtime fix for wiring a constructable frame with cables who were deleted. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5485 316c924e-a436-60f5-8080-3fe189b3f50e --- code/game/machinery/constructable_frame.dm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm index 701cf3fb92..aa5a7f8bea 100644 --- a/code/game/machinery/constructable_frame.dm +++ b/code/game/machinery/constructable_frame.dm @@ -20,15 +20,17 @@ switch(state) if(1) if(istype(P, /obj/item/weapon/cable_coil)) - if(P:amount >= 5) + var/obj/item/weapon/cable_coil/C = P + if(C.amount >= 5) playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) user << "\blue You start to add cables to the frame." if(do_after(user, 20)) - P:amount -= 5 - if(!P:amount) del(P) - user << "\blue You add cables to the frame." - state = 2 - icon_state = "box_1" + if(C) + C.amount -= 5 + if(!C.amount) del(C) + user << "\blue You add cables to the frame." + state = 2 + icon_state = "box_1" if(istype(P, /obj/item/weapon/wrench)) playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) user << "\blue You dismantle the frame"