From ef2c62c63af21fc720cc33b7c8b5339ca3e40aed Mon Sep 17 00:00:00 2001 From: Cameron653 Date: Thu, 21 Jun 2018 03:26:02 -0400 Subject: [PATCH] Alien Cable Coil Fix (#5365) * Prevents the infinite cable coil alien tool from making more infinite cable coil tools. * Prevents you from going over the 30 cap. * Tochat --- code/modules/power/cable.dm | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index 5ad1e727da..4085a7c9df 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -939,4 +939,25 @@ obj/structure/cable/proc/cableColor(var/colorC) if(get_dist(src, user) <= 1) msg += " It doesn't seem to have a beginning, or an end." - to_chat(user, msg) \ No newline at end of file + to_chat(user, msg) + +/obj/item/stack/cable_coil/alien/attack_hand(mob/user as mob) + if (user.get_inactive_hand() == src) + var/N = input("How many units of wire do you want to take from [src]? You can only take up to [amount] at a time.", "Split stacks", 1) as num|null + if(N && N <= amount) + var/obj/item/stack/cable_coil/CC = new/obj/item/stack/cable_coil(user.loc) + CC.amount = N + CC.update_icon() + to_chat(user,"You take [N] units of wire from the [src].") + if (CC) + user.put_in_hands(CC) + src.add_fingerprint(user) + CC.add_fingerprint(user) + spawn(0) + if (src && usr.machine==src) + src.interact(usr) + else + return + else + ..() + return