Merge pull request #9663 from PsiOmegaDelta/150604-StackFixes

Stack splitting and cable merging fixes.
This commit is contained in:
GinjaNinja32
2015-06-04 23:19:08 +01:00
3 changed files with 18 additions and 0 deletions

View File

@@ -252,6 +252,7 @@
var/orig_amount = src.amount
if (transfer && src.use(transfer))
var/obj/item/stack/newstack = new src.type(loc, transfer)
newstack.color = color
if (prob(transfer/orig_amount * 100))
transfer_fingerprints_to(newstack)
if(blood_DNA)

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