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
This commit is contained in:
aranclanos@hotmail.com
2013-01-07 11:44:31 +00:00
parent 26b7c43cb6
commit 6bb146262c

View File

@@ -20,15 +20,17 @@
switch(state) switch(state)
if(1) if(1)
if(istype(P, /obj/item/weapon/cable_coil)) 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) playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
user << "\blue You start to add cables to the frame." user << "\blue You start to add cables to the frame."
if(do_after(user, 20)) if(do_after(user, 20))
P:amount -= 5 if(C)
if(!P:amount) del(P) C.amount -= 5
user << "\blue You add cables to the frame." if(!C.amount) del(C)
state = 2 user << "\blue You add cables to the frame."
icon_state = "box_1" state = 2
icon_state = "box_1"
if(istype(P, /obj/item/weapon/wrench)) if(istype(P, /obj/item/weapon/wrench))
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
user << "\blue You dismantle the frame" user << "\blue You dismantle the frame"