Stack splitting and cable merging fixes.

Split stacks will now keep the same colors.
Can now only join cables of the same color together, unless you are a borg.
This commit is contained in:
PsiOmegaDelta
2015-06-04 13:24:12 +02:00
parent 5fd97e6dfd
commit 65fc980b20
2 changed files with 12 additions and 0 deletions

View File

@@ -613,6 +613,12 @@ obj/structure/cable/proc/cableColor(var/colorC)
// Items usable on a cable coil :
// - Wirecutters : cut them duh !
// - Cable coil : merge cables
/obj/item/stack/cable_coil/proc/can_merge(var/obj/item/stack/cable_coil/C)
return color == C.color
/obj/item/stack/cable_coil/cyborg/can_merge()
return 1
/obj/item/stack/cable_coil/attackby(obj/item/weapon/W, mob/user)
..()
if( istype(W, /obj/item/weapon/wirecutters) && src.get_amount() > 1)
@@ -623,6 +629,11 @@ obj/structure/cable/proc/cableColor(var/colorC)
return
else if(istype(W, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/C = W
if(!can_merge(C))
user << "These coils do not go together."
return
if(C.get_amount() >= get_max_amount())
user << "The coil is too long, you cannot add any more cable to it."
return